JavaScript RegExp exec()
JavaScript RegExp exec()
The exec() method is used to test for a match in a string. If a match is found, it will return a result array else it will return null.
Syntax:-
Its syntax is:- RegExpObject.exec(string)
Return:-
Its return is:- array containing the matched text if match found else null
Further Explanation:-
Parameter | Description |
---|---|
string | Required. The string to be searched |