JavaScript does not support lookbehind groups.
In addition, your regular expression is created from strings. You must make sure that the regular expression metacharacters "survive" in the process of parsing the string, and in particular, your \s must be expressed as \\s .
Please note that the characters . in the URL of your pattern will be interpreted as the "wildcard" character of the regular expression, unless you also put \\ in front of it.
Finally, it is not clear what you expect from these {1} things; in JavaScript, which will match the sequence of characters {1} .
source share