exec

Executes a search on a string using a regular expression pattern, and returns an array containing the results of that search.

Parameters

string

The String object or string literal on which to perform the search.

MDN Reference