RegExp {X} quantifier
Definition and Usage
n{X,} quantifier matches strings comprising the sequence of Xn's.
Xmust be numeric.
grammar
new RegExp("n{X}")
或者更简单方式:
/n{X}/
或者更简单方式:
/n{X}/
Browser Support
All major browsers support {X} quantifier.
Examples
Examples
Of the sub-sequence contains a four-digit string global search:
var str="100, 1000 or 10000?";
var patt1=/d{4}/g;
var patt1=/d{4}/g;
The marked text below shows where the expression gets a match:
100, 1000 or 1000 0?
try it"
JavaSript RegExp objects