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.24.3. This function has been downloaded 63 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 directly requires the following function which is included automatically:

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

Requiring Functions

This function is directly required by the following functions:

  • matchAll()
    Gets all of the matches found when matching a regular expression against a string.
  • translate()
    Substitutes substrings with different strings. Similar to doing multiple replacements while making sure that none of the replacements overlap.