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