Easy Tutorial
❮ Prop Canvas Strokestyle Home ❯

JavaScript RegExp {X,} Quantifier


Definition and Usage

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

X must be a number.

Syntax


Browser Support

All major browsers support the {X,} quantifier.


Example

Perform a global search for a substring that contains a sequence of at least three digits:

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

The text marked below shows where the expression matches: 100, 1000 or 10000?


❮ Prop Canvas Strokestyle Home ❯