From http://www.w3schools.com (Copyright Refsnes Data)
JavaScript RegExp Object
The exec() method tests for a match in a string.
This method returns the matched text if it finds a match, otherwise it returns null.
| RegExpObject.exec(string) |
| Parameter | Description |
|---|---|
| string | Required. The string to be searched |
ExampleDo a global search, and test for "Hello" and "W3Schools" in a string:
The output of the code above will be:
Try it yourself » |
JavaScript RegExp Object
From http://www.w3schools.com (Copyright Refsnes Data)