0

I have the following Regex expression:

(?<=>[^<]*)(abc)

The idea behind the expression (I think) is to find any instance of the letters abc, or whatever the user search for, that are not in any tag.

See the example: https://regex101.com/r/bsNFne/2 (only works in Chrome)

The problem is that positive lookahead is not supported in Internet Explorer or Edge.

I have attempted different conversions, but I cannot find a Regex that works in Internet Explorer and achieves the same result as the above regex in Chrome.

How can I convert the regex to function in all major browsers?

MortenGR
  • 793
  • 1
  • 7
  • 20
  • 1
    Only way right now (for JavaScript outside of Chrome) is to use a capture group `(>[^ – ctwheels Mar 08 '18 at 15:09
  • Good thinking! However, this only seems to function when there's at least one tag, what if the user just typed abc? Maybe I could just add a content tag somewhere, or maybe there's a more elegant solution? – MortenGR Mar 08 '18 at 15:35

0 Answers0