Link to home
Start Free TrialLog in
Avatar of campinam
campinam

asked on

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)
Avatar of aikimark
aikimark
Flag of United States of America image

I'm surprised it works in .Net
I think this should work:
 (?<=>[^<]*?\W)ă

Open in new window


\W is a non-word (non-letter, non-number) character.
Avatar of campinam
campinam

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.
ASKER CERTIFIED SOLUTION
Avatar of wilcoxon
wilcoxon
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial