In VSCode if I use f(?=\=)
in the regex find and replace I get an error that says:
Invalid regular expression: /f(?=\=)/: Invalid escape
however, if I do f(?==)
it works fine. I don't see any issue with the first regex, its just a specifying the literal =
sign as a positive lookahead. Why can you not escape an =
sign?
In your regex, (?=
starts a positive lookahead, but your second =
is the part being matched, not part of that specific syntax. So the slash is interpreted as an escape, and an escaped =
sign is invalid.