JavaScript RegExp ?! Quantifier
- Previous Page ?=
- Next Page constructor
- Go Up One Level JavaScript RegExp Reference Manual
Definition and Usage
?!n Quantifiers to match any string that is not immediately followed by a specified string n string.
Tip:Use ?=n Quantifiers to match any string that is immediately followed by a specified string n string.
Example
Perform a global, case-insensitive search for "is", not immediately followed by "all":
let text = "Is this all there is"; let pattern = /is(?! all)/gi;
Syntax
new RegExp("regexp(?!n)
or abbreviated as:
/regexp(?!n)/
Syntax with modifiers
new RegExp("regexp(?!n)", "g")
or abbreviated as:
/regexp(?!n)/g
Browser Support
/(?!n)/
Is ECMAScript1 (ES1) Feature.
All browsers fully support ES1 (JavaScript 1997):
Chrome | IE | Edge | Firefox | Safari | Opera |
---|---|---|---|---|---|
Support | Support | Support | Support | Support | Support |
- Previous Page ?=
- Next Page constructor
- Go Up One Level JavaScript RegExp Reference Manual