Skip to content

Latest commit

 

History

History
20 lines (13 loc) · 522 Bytes

no-regexp-lookbehind.md

File metadata and controls

20 lines (13 loc) · 522 Bytes

no-regexp-lookbehind

This prevents the use of the RegExp lookbehind feature

/(?<=a>)b/

new RegExp("/(?<=a)b")

These will not be allowed because they are not supported in the following browsers:

  • Edge < 79
  • Safari (any version at the time of writing)
  • Firefox (any version at the time of writing)
  • Chrome < 62

What is the Fix?

You may be able to rewrite your expression using (Negative) Lookaheads, but if not then there is no solution for this, aside from pulling in a custom RegExp library.