JavaScript RegExp ?! quantifier
The JavaScript RegExp object
Definition and Usage
The ?!n The quantifier matches any string not immediately followed by the specified string n .
Syntax
new RegExp("
regexp
(?!
n)
")
or
/
regexp
(?!
n)
/
Browser support





All major browsers support the ?! quantifier.
Example
Example
Perform a global search for "is" not immediately followed by "all":
var str="Is this all there is";
var patt1=/is(?! all)/gi;
The text marked below shows where the expression found matches:
Is
this all there
is
Try it »
The JavaScript RegExp object