Syntax or pattern
Extract matching parts of text with a regular expression.
=REGEXEXTRACT(text, regular_expression)5 practical examples
Extract an email from text
Pull the first email address from a messy note.
=REGEXEXTRACT(A2, "[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")Adjust the ranges, criteria and sheet names to match your workbook.
Extract numbers from an order code
Return the numeric part of an ID or code.
=REGEXEXTRACT(A2, "[0-9]+")Adjust the ranges, criteria and sheet names to match your workbook.
Extract text between brackets
Capture a tag or category inside square brackets.
=REGEXEXTRACT(A2, "\[(.*?)\]")Adjust the ranges, criteria and sheet names to match your workbook.
Extract a domain from URL
Return only the domain portion of a web address.
=REGEXEXTRACT(A2, "https?://([^/]+)")Adjust the ranges, criteria and sheet names to match your workbook.
Extract a SKU pattern
Capture a product code that follows a consistent pattern.
=REGEXEXTRACT(A2, "[A-Z]{3}-[0-9]{4}")Adjust the ranges, criteria and sheet names to match your workbook.
Common mistakes to avoid
- Using patterns that are too broad and capture the wrong text.
- Forgetting to escape special characters.
- Assuming every row has a match.
FAQ
What is this Google Sheets page for?
This page gives copy-ready examples for regexextract examples so you can understand the pattern and adapt it to real spreadsheet work.
Can I copy these formulas directly?
Yes. Use the copy buttons, then adjust sheet names, ranges, criteria and column references for your own file.
Why does my formula return an error?
The most common causes are mismatched ranges, missing quotes around text criteria, blank source data, or references that do not match your sheet layout.
Here are some ideas for you
Optional resources that may help if you are learning Google Sheets, building trackers, creating dashboards or improving spreadsheet workflows.
- Google Sheets booksSee ideas
Learn formulas, workflows and dashboards with structured examples.
- Spreadsheet dashboard booksSee ideas
Improve how you design trackers, summaries and reporting sheets.
- Keyboard shortcut guidesSee ideas
Build speed with navigation, editing and formatting shortcuts.
- Numeric keypadsSee ideas
Useful if you enter numbers often on a laptop or compact keyboard.
- External monitorsSee ideas
Helpful for viewing data, formulas and dashboards side by side.
- Desk notebooksSee ideas
Sketch formulas, tracker layouts and reporting ideas before building.
Some links in this section may be affiliate links. Choose only what is useful for your own work.