FormulaCamp
Completed
← All functions
Text

REGEXEXTRACT

Extracts a match: mode 0 is the first, 1 all (array), 2 capture groups.

Syntax

REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])

Example: =REGEXEXTRACT(A2,"\d+")

Available in: Microsoft 365 only

Try it

A tiny spreadsheet with example data. Edit the formula or any number and see the result.

Formula in D2: =REGEXEXTRACT(A7,"\d+")

Example spreadsheet for REGEXEXTRACT
ABCD
1TextOtherResult
2Alice Johnsonalice johnson417
3alice@shop.comALICE@shop.com
4 extra spaces
5SKU-2026-0415
6iced coffee, tea, sugar
7Order 417 shipped
Result in D2: 417
Practice this in a lesson: REGEX Functions

More in Text