JavaScript | RegExp test() Method
The RegExp test() Method in JavaScript is used to test for match in a string. If there is a match this method returns true else it returns false.
Syntax:
RegExpObject.test(str)
Where str is the string to be searched. This is required field.