Easy Tutorial
❮ Jsref Lastindexof Prop Meter Min ❯

JavaScript RegExp {X} Quantifier

JavaScript RegExp Object


Definition and Usage

The {X,} quantifier matches strings that contain a sequence of X n's.

X must be a number.

Syntax


Browser Support

All major browsers support the {X} quantifier.


Examples

Perform a global search for a substring that contains a sequence of four digits:

var str="100, 1000 or 10000?";
var patt1=/\d{4}/g;

Match four digits:

var str="100, 1000 or 10000?";
var patt1=/\d{4}/g;

JavaScript RegExp Object

❮ Jsref Lastindexof Prop Meter Min ❯