execAll()

Gets all of the matches found when matching a regular expression against a string.

This function is valid in v2.11.0 to v2.13.1. This function has been downloaded 17 times.

Parameters

{RegExp} rgx
Regular expression to match against str.
{string} str
String against which the regular expression should be matched.
{function(Array,number)=} opt_fnMapper Optional
If specified the return value of this function will always be appended to the array which will be returned by matchAll() unless undefined is the return value. The 1st argument passed will be an array representing the matches array that was found. The 2nd argument passed will be the amount of times this mapper has been called.

Returns

{Array|null}
If rgx matched a substring in str at least once and opt_fnMapper wasn't used, an array of all of the matches will be returned. Each match will at least have match[0], match.index (the starting index of the found match within str), match.source (rgx) and match.input (str). If capture groups were specified in rgx, each will be found in its corresponding index starting with match[1]. If no matches were found, null is returned.

Required Function

This function requires the following function which is included automatically:

  • matchAll()
    Gets all of the matches found when matching a regular expression against a string.