I have this piece of code:
_regex = /((?<!placeholder)\w+(?:\s*=\s*(?:"[^"]*"|'[^']*')))/;
imgTag = imgTag.replaceAll(_regex, ' ');
Have also tried this instead:
imgTag = imgTag.replace( new RegExp( /((?<!placeholder)\w+(?:\s*=\s*(?:"[^"]*"|'[^']*')))/, "gi" ), ' ');
But my code never gets passed this line:
_regex = /((?<!placeholder)\w+(?:\s*=\s*(?:"[^"]*"|'[^']*')))/;
Or this line:
imgTag = imgTag.replace( new RegExp( /((?<!placeholder)\w+(?:\s*=\s*(?:"[^"]*"|'[^']*')))/, "gi" ), ' ');
So the problem is in my RegEx, right?
I can't see it, can anyone please shed a light?
Thanks!