What is REGEXREPLACE in Google Sheets?
REGEXREPLACE finds text matching a regex pattern and replaces it with new text. Strip non-digits from phones, normalize spaces, or remove tags from HTML snippets in bulk without one-off find-and-replace menus.
When to use it
Use REGEXREPLACE in cleaning pipelines for imports, standardizing SKUs, or removing unwanted characters before VLOOKUP.
When to skip it
Skip REGEXREPLACE for one cell manual edits or when SUBSTITUTE on a fixed string is clearer.
How it works
-
1
Pass the source text as the first argument.
-
2
Write the regex pattern to find as the second argument.
-
3
Pass replacement text as third argument; use $1 for capture group inserts.
-
4
Apply globally down a column with MAP or ARRAY spill behavior.
-
5
Chain two REGEXREPLACE calls when multiple cleanup passes are needed.
-
6
Spot-check ten random rows after bulk replace before deleting source columns.
Examples in Google Sheets
Phone digits only
=REGEXREPLACE(A2, "[^0-9]", "") keeps only numerals for matching.
Normalize spaces
=REGEXREPLACE(B2, "\s+", " ") collapses double spaces to one.
Strip HTML tags
=REGEXREPLACE(C2, "<[^>]+>", "") removes simple tags from scraped text.
Better Sheets resources
Common mistakes
-
Replacement string with unescaped $ confusing capture references.
-
Pattern too aggressive, deleting meaningful punctuation.
-
Not backing up source column before irreversible cleanup.
-
Expecting REGEXREPLACE to fix structural CSV problems alone.
-
Running heavy regex on full column A:A in a shared mega sheet.
Frequently asked questions
- REGEXREPLACE vs SUBSTITUTE?
- SUBSTITUTE swaps fixed strings. REGEXREPLACE uses pattern matching.
- Use capture groups?
- Yes. Replacement can reference $1, $2 from parentheses in the pattern.
- Replace all matches?
- REGEXREPLACE replaces all matches in the cell by default in Sheets.
- REGEXREPLACE on numbers?
- Convert with TEXT first or apply on text-formatted columns.
- REGEXREPLACE tools?
- Better Sheets regex replacer tool helps test patterns before pasting into sheets.
- Case sensitive?
- Default regex case rules apply. Adjust pattern classes as needed.
- REGEXREPLACE errors?
- Invalid regex syntax returns formula parse errors. Test in small cells.
Related Tutorials
Watch how REGEXREPLACE works
REGEXMATCH Formula Generator for Google Sheets
200 REGEXMATCH Examples in Google Sheets
How to Replace Text with a Blank Cell in Google Sheets
Related blog posts
Guides that explain REGEXREPLACE in more depth.
Philippines Phone Number Validation: Use of REGEXMATCH in Google Sheets
Every school year thousands of students and teachers’ data were being added to the school database. As someone who was always given the task to narrow down lots of information after the school enrollment, validating students’ data manually is very exhausting. Take this as an example, when you ask students to include the phone numbers of their emergency contact person, there are some instances wherein the declared numbers were invalid due to human error. And the assigned personnel during enr...
Read post →Google Sheets Locales. What are they?
Hello, Better Sheet members and non-Better Sheet members! This tutorial is about every locale listed in Google Sheets. If you live in a country that is not well represented with blog posts or someone makes a blog post about a Google Sheets issue, they create a Google Sheet formula and then you copy and paste it into your sheet and it has the wrong delimiter. How do you resolve that? I'm going to show you how you can fix that and how you can know if there's a problem. Locales. What are the...
Read post →Related terms
REGEXMATCH
REGEXMATCH returns TRUE or FALSE when text matches a regular expression pattern. Use it in FILTER, IF, and COUNTIF to validate emails, extract structure flags, or flag messy imports before they break downstream reports.
Read guide →REGEXEXTRACT
REGEXEXTRACT returns the portion of text that matches a regular expression, often using capture groups to pull IDs, domains, or codes from longer strings. It replaces manual LEFT/RIGHT/MID chains when patterns repeat.
Read guide →SPLIT
SPLIT divides one text cell into multiple cells spilled across columns using a delimiter such as comma, space, or custom string. It is the formula version of Text to columns for live data like tags, full names, or combined codes.
Read guide →TEXTJOIN
TEXTJOIN merges many text values into one string with a delimiter between them. The ignore_empty argument skips blanks so you do not get double commas. It builds display labels, CSV-like rows, and summary lines from wide tables.
Read guide →Done reading about REGEXREPLACE?
Membership unlocks 600+ tutorials, unlimited generators, and every template. Practical lessons. Zero fluff.
Need this once
Jump to a free tool or a single tutorial for this topic.
Learning Sheets for real
Unlock the full library, generators, and templates with membership.