JavaScript RegExp {X,}Quantifier
JavaScript RegExp Object
Definition and Usage
n{X,} Quantifier matches containing at least Xnof sequences of strings.
XMust be a number.
Syntax
new RegExp("n{X,}")
Or a simpler way:
/n{X,}/
Or a simpler way:
/n{X,}/
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the {X,} quantifier
Example
Example
Perform a global search for substrings that contain a sequence of at least three digits:
var str="100, 1000 or 10000?";
var patt1=/\d{3,}/g;
Belowmarkedtext shows the position where the expression gets a match:
100, 1000 or 10000?
Try it yourself »
JavaScript RegExp Object Other extensions