RegExp.exec

Array exec (String text)

Parameters

text The string to match.

Description

Execute a regular expression.

The return value is an array of matches, with the first element containing the match, and successive elements containing the results of any matching subexpression in their order of appearance. If there is no match, the result is null.