About
Pricing
Community
Teams
Start Free Trial
Log in
campinam
asked on
12/7/2019
Convert regex to regexp
In .Net the regex
(?<=>[^<]*?)\bă
works as expected (find words that start with
ă
and are not located within a tag).
But in JavaScript Chrome
\b
won't work with Unicode texts.
What would be the correct equivalent in JavaScript for the above .Net expression?
(I am referring to the latest versions of regex/regexp)
Regular Expressions
.NET Programming
Chrome
JavaScript
Scripting Languages
+1
4
1
Last Comment
wilcoxon
8/22/2022 - Mon
aikimark
12/7/2019
I'm surprised it works in .Net
wilcoxon
12/7/2019
I think this should work:
(?<=>[^<]*?\W)ă
Select all
Open in new window
\W is a non-word (non-letter, non-number) character.
campinam
12/7/2019
ASKER
\W is a non-word, but an ASCII construct n JavaScript. It matches non-ASCII letters as well, even with the u flag. So it won't do.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes
ASKER CERTIFIED SOLUTION
wilcoxon
12/7/2019
THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.