JavaScript String match() method is used to search a string for a match against any regular expression and will return the match as an array if any match found.

Javascript regex match

JavaScript match() method searches a string for a match versus a regular expression, and returns the matches, as the array. To use a javascript regex match, use a string match() method.

Syntax

string.match(regexp)

#Javascript

Javascript regex match: Check If String Matches Regex
6.00 GEEK