Help Centre › Functions & Formulas
For a full list of available calculation functions, please read What calculation functions are supported.
This article describes the formula syntax and usage of the REGEXEXTRACT function.
Description
Extracts matching substrings according to a regular expression.
Syntax
REGEXEXTRACT(text, regular_expression)
The REGEXEXTRACT function has the following arguments:
- text - Required. The text to search for a match.
- regular_expression - Required. The regular expression to match against text.
Remarks
- If there is no match, REGEXEXTRACT returns an error.
- The regular expression must match the entire text string. If you want to extract only part of the text, use parentheses in the regular expression to capture the part you want to extract.
Example
| Formula | Description | Result |
| =REGEXEXTRACT("abc123", "[0-9]+") | Extracts the first sequence of digits from the string "abc123". | 123 |
Errors
For a full list of formula errors, please read Formula errors.