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.

Syntax

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.

Example

Try the below example.

Output

Chapter 3.4.5.1,Chapter 3.4.5.1,.1


All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd DMCA.com Protection Status

Javascript Objects Topics