Phone digits only
=REGEXREPLACE(A2, "[^0-9]", "") keeps only numerals for matching.
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.
Use REGEXREPLACE in cleaning pipelines for imports, standardizing SKUs, or removing unwanted characters before VLOOKUP.
Skip REGEXREPLACE for one cell manual edits or when SUBSTITUTE on a fixed string is clearer.
Pass the source text as the first argument.
Write the regex pattern to find as the second argument.
Pass replacement text as third argument; use $1 for capture group inserts.
Apply globally down a column with MAP or ARRAY spill behavior.
Chain two REGEXREPLACE calls when multiple cleanup passes are needed.
Spot-check ten random rows after bulk replace before deleting source columns.
=REGEXREPLACE(A2, "[^0-9]", "") keeps only numerals for matching.
=REGEXREPLACE(B2, "\s+", " ") collapses double spaces to one.
=REGEXREPLACE(C2, "<[^>]+>", "") removes simple tags from scraped text.
Watch how REGEXREPLACE works
Guides that explain REGEXREPLACE in more depth.
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 →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 →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 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 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 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 637+ 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.