JavaScript Objects The Strings Object- match() - Javascript Objects

What is JavaScript String - match() Method?

JavaScript String - match() method is used to retrieve the matches when matching a string against a regular expression.


Use the below syntax to use the match() method.

Argument Details

param − A regular expression object.

Return Value

If the regular expression does not include the g flag, it returns the same result as regexp.exec(string).

If the regular expression includes the g flag, the method returns an Array containing all the matches.


Try the below example.



All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

Javascript Objects Topics