I am having a problem using the following regex. It works fine in regexr and rubular but it gives me an error when running it on node.js. I am fairly new to using regex and i'm not sure what i'm doing wrong. It will work if I knock off the (?<= )
so I presume that is the problem.
I'm trying to match 'is' with a leading and trailing space using /(?<= )is(?= )|==/g
Example with test words:
http://regexr.com?33781
Node error output
temp = temp.replace(/(?<= )is(?= )|==/g, '===');
^
SyntaxError: Invalid regular expression: /(?<= )is(?= )|==/: Invalid group
at new RegExp (unknown source)