Definition and Usage When the {x} modifier is set the regular expression finds a specific number of the regular expression grouped together...
Definition and Usage
When the {x} modifier is set the regular expression finds a specific number of the regular expression grouped together.
The characters inside the brackets must be a number.
Syntax
Parameter | Description |
regexp | Required. The rest of the regular expression to use |
Example
In the following code we will do a search for any substring with four digits:
var str = "100 or 1000?";
var patt1 = /\d{4}/; |
The
marked text below shows where the RegExp gets a match: