RegExp?! Quantifier
Definition and Usage
The?!N quantifier not immediately followed by any string matches the specified stringn.
grammar
new RegExp("regexp(?!n)")
或者
/regexp(?!n)/
或者
/regexp(?!n)/
Browser Support
All major browsers support?! Quantifiers.
Examples
Examples
Not keeping up with "all" the "is" a global search for them later:
var str="Is this all there is";
var patt1=/is(?! all)/gi;
var patt1=/is(?! all)/gi;
The marked text below shows where the expression gets a match:
Is this all there is
try it"
JavaSript RegExp objects