JavaScript RegExp {x} Modifier
Complete RegExp Object Reference
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:
Try-It-Yourself Demos
{x}
How to use the "{x}" modifier to find a specific number of specified characters
grouped together using a string object.
Complete RegExp Object Reference
The Altova MissionKit is a suite of intelligent XML tools, including:
XMLSpy® – industry-leading XML editor
- Support for all XML-based technologies
- Graphical editing views, powerful debuggers, code generation, & more
MapForce® – graphical data mapping tool
- Drag-and-drop data conversion with code generation
- Support for XML, DBs, EDI, Excel® 2007, text, Web services
StyleVision® – visual stylesheet designer
- Drag-and-drop stylesheet design for XML & databases
- Output to HTML, PDF, RTF, Word 2007, & more
And more…
Try before you buy with a free fully functional 30-day trial
Download today
|