I have a regex which finds any string between 2 ##
-characters:
var regex = new RegExp('(?<=\#\#)(.*?)(?=\#\#)');
var matchResult = searchString.match(regex);
E.g. a string
"test bla bla ##TARGET## blablabla"
gives me TARGET
, which is what I want.
It is working fine in Chrome and Firefox. However MS Edge gives me the error message:
Unexpected quantifier
How do I need to change the regex, that it also works for Microsoft Edge?
I tried escaping the ?
but that did not help. Which characters do I need to escape?