JavaScript RegExp ?= Quantifier

Definition and Usage

?=n Quantifiers to match any sequence that immediately follows a specified string n string.

Tip:Please use ?!n Quantifiers to match any sequence that does not immediately follow a specified string n string.

Example

Search for "is" followed by "all":

let text = "Is this all there is";
let pattern = /is(?= all)/g;

Try it yourself

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