1. Introduction to the REGEXEXTRACT Function
The REGEXEXTRACT function in Excel is a powerful tool for extracting specific information from text strings using regular expressions (regex).
This function is particularly useful for parsing structured data, such as phone numbers, emails, and dates, allowing you to automate data processing tasks and enhance data analysis capabilities.
This function is particularly useful for parsing structured data, such as phone numbers, emails, and dates, allowing you to automate data processing tasks and enhance data analysis capabilities.

2. Parameters of the REGEXEXTRACT Function
Here is the syntax for using the
REGEXEXTRACT
function.=REGEXEXTRACT(text, pattern, [return_mode], [case_sensitivity])
text
: required The text or the reference to a cell containing the text you want to extract strings from. pattern
: required The regular expression ("regex") that describes the pattern of text you want to extract. return_mode
: optional A number that specifies what strings you want to extract. By default, return mode is 0. The possible values are: 0
: Return the first string that matches the pattern1
: Return all strings that match the pattern as an array2
: Return capturing groups from the first match as an arraycase_sensitivity
: optional Determines whether the match is case-sensitive. By default, the match is case-sensitive. Enter one of the following: 0
: Case sensitive1
: Case insensitive3. Example Scenario: Extracting Phone Numbers
In this tutorial, we will demonstrate how to use the
REGEXEXTRACT
function to extract phone numbers from a list.
4. Getting Started with the REGEXEXTRACT Function
Type on your keyboard:
=REGEXEXTRACT(
, then select A5
as the text to be processed.
5. Input the Regular Expression
To extract phone numbers, we input:
Explanation of phone number regex:
\(\d{3}\)\s?\d{3}[-\s]?\d{4}
as the regular expression. Explanation of phone number regex:
Common Regular Expressions for Excel Users

6. REGEXEXTRACT Function Takes Effect
After pressing Enter to save, we can see that we have successfully extracted the phone number.

7. Apply to Other Cells
Apply the
REGEXEXTRACT
function to the remaining cells to complete the phone number extraction.
8. Extract All Matches
When we set
return_mode
to 1
, all matches will be extracted.
9. Capture Groups
When we set
return_mode
to 2
, the matching content of the regular expression will be returned split by the capture groups.
10. 🎉 Finish! 🎉
Author's Note: I hope you can feel the effort I put into these tutorials. I hope to create a series of very easy-to-understand Excel tutorials.If it is useful, help me share these tutorials, thank you!
Follow me:
Related Tutorials
