Regular Expression Methods
There are a number of methods that can be used to work with regular expressions in JavaScript. Some of the most common methods are:
test()
The test() method checks if a string contains a match for a pattern and returns true or false.
exec()
The exec() method searches a string for a pattern match and returns information about the match.
match()
The match() method searches a string for a pattern match and returns an array of matches.