REGEXEXTRACT in Google Sheets

Returns the part of a text that matches a pattern (a regular expression).

Syntax

REGEXEXTRACT(text, regular_expression)
text
The text to search. It must be text; a number gives #VALUE!.
regular_expression
The pattern in quotes, such as "\d+" for one or more digits.

Examples

C1=REGEXEXTRACT(A2,"\d+")
ABC
1Note1001
2Order 1001 shipped

In plain words: Pull the first run of digits out of the note in A2.

C1=REGEXEXTRACT(A2,"@(.+)$")
ABC
1Emailexample.com
2ann@example.com

Practice REGEXEXTRACT

Related functions