TX Sheet Control

REGEXEXTRACT Function

Function

Extract the text that matches a regular expression. text is the text to search and pattern the regular expression. return_mode selects the result: 0 the first match (the default), 1 all matches as an array, or 2 the capturing groups of the first match as an array. case_sensitivity 0 or omitted matches case-sensitively and 1 ignores case. No match returns #N/A, and an invalid pattern or return_mode returns #VALUE!.

Syntax

REGEXEXTRACT(text, pattern, return_mode, case_sensitivity)

Category: Text. Minimum arguments: 2. Maximum arguments: 4.

Available for supported offline calculation.

Examples

=REGEXEXTRACT("TX42","[0-9]+")

The formula returns 42.

Cell and range examples require appropriate input values in the referenced cells. Handle invalid arguments, formula errors and array and spill constraints.

See Also