I'm using regexes with JavaScript and I'm having some trouble with one that returns me Invalid quantifier ?
.
This is the code:
if(url.match(new RegExp('^https?://.+/foresee(?:-|_)surveydef\.js(?:\?)(.*)','g')) != null)
I read on other questions that I need to add a \
before the ?
character but it does not fix it...
if(url.match(new RegExp('^https\?://.+/foresee(\?:-|_)surveydef\.js(\?:\?)(.*)','g')) != null)
The input url is http://marvel.com/
, I just check for a match.