Name

match() — NN 4 IE J3 ECMA n/a

Synopsis

match(regexpression)

Returns an array of strings within the current string that match the regular expression passed as a parameter. For example, if you pass a regular expression that specifies any five-digit number, the returned value of the match() method would be an array of all five-digit numbers (as strings) in the main string. Properties of the RegExp static object are influenced by this method’s operation.

Returned Value

An array of strings.

Parameters

regexpression

A regular expression object. See the regular expression object for the syntax to create a regular expression object.

Get Dynamic HTML: The Definitive Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.