Pull out the first substring that matches a regular expression.
This function works the same in Google Sheets as it does in Excel — same syntax and arguments.
REGEXEXTRACT(text, regular_expression)REGEXEXTRACT returns the part of a string matching a regex pattern — great for parsing IDs, numbers, or domains. Excel has no native regex functions (until recent additions), making this a Sheets advantage.
=REGEXEXTRACT(A2, "\d+")Result: First number
Extracts the first run of digits from A2.
Newer Microsoft 365 added REGEXEXTRACT; otherwise Excel relied on add-ins or VBA.