Can anyone understand why this gives an error Invalid regular expression: Invalid group?
text.replace(/(?<!br|p|\/p|b|\/b)>/g, ">");
This is normal:
text.replace(/<(?!br|p|\/p|b|\/b)/g, "<");
So I'm not sure where I am wrong in the first ( >).
Here's a fiddle with an example.
source
share