JavaScript RegExp test()
JavaScript RegExp test()
The test() method is used to test for a match in a string. If a match is found, it will return true or else false.
Syntax:-
Its syntax is:- RegExpObject.test(string)
Return:-
Its return is:- true if a match occurs else false
Further Explanation:-
Parameter | Description |
---|---|
string | Required. The string to be searched |