Validate email shape
REGEXMATCH(A2, "^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,}$") flags rows to fix before a mail merge.
Regular expressions (regex) describe text patterns. Google Sheets exposes them through REGEXMATCH (test), REGEXEXTRACT (pull a substring), and REGEXREPLACE (swap text). They shine when TRIM and SPLIT are not enough for inconsistent labels, URLs, or log lines.
Use regex when you need to test format (email-like strings), extract order IDs from notes, pull domains from URLs, or clean merged export fields without manual find-and-replace.
Skip regex for simple equals checks or fixed-width splits. Avoid nested regex on huge columns if a helper table or Apps Script with clear steps is easier for teammates to maintain.
{:"Pick the function"=>"REGEXMATCH for true/false, REGEXEXTRACT for first capture, REGEXREPLACE to rewrite."}
Write a pattern in quotes. Google uses RE2 syntax; backslashes escape special characters like . and ?.
Use capturing groups (... ) in REGEXEXTRACT to return the part you need from a longer string.
Combine with IF, ARRAYFORMULA, or FILTER so one formula covers a column without dragging forever.
Test the pattern on five messy real rows before filling down ten thousand cells.
Document the pattern in a comment row or Notes column so the next editor knows what it matches.
REGEXMATCH(A2, "^[\\w.-]+@[\\w.-]+\\.[a-zA-Z]{2,}$") flags rows to fix before a mail merge.
REGEXEXTRACT(B2, "INV-(\\d+)") pulls digits from strings like "Paid INV-10492 via wire".
REGEXREPLACE(C2, "[^0-9]", "") strips punctuation so VLOOKUP keys align across systems.
Build this without starting from a blank cell
Use a Better Sheets tool for regex in Google Sheets, then watch a walkthrough when you want the full pattern.
Watch how regex in Google Sheets works
Guides that explain regex in Google Sheets 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 →Extract url from hyperlink google sheets.Skip the Command K. This Google Sheet tutorial will make it easier for you to extract URLS from Google Sheets.
Read post →Every formula starts with = followed by a function name and arguments in parentheses. Ranges use A1 notation, text sits in quotes, and operators like + and & combine values. Sheets recalculates when inputs change, so syntax errors show as #NAME? or #ERROR! in the cell.
Read guide →Normalizing means making inconsistent inputs follow one reliable shape: same date format, trimmed text, unique keys, one fact per row, and separate columns for categories that were crammed into one field. Clean data makes VLOOKUP, QUERY, and dashboards dependable.
Read guide →The QUERY function runs a SQL-like statement against a range in your sheet. You SELECT columns, filter with WHERE, sort with ORDER BY, and aggregate with GROUP BY without building many helper columns. It is the closest native option to a small in-sheet database query.
Read guide →Visual formulas are spreadsheet layouts where the formula output is meant to be seen, not just calculated: sparkline strips, emoji status icons, color scales, and REPT bars that communicate trend and health at a glance. They sit between raw numbers and full chart objects for dense dashboards.
Read guide →Done reading about regex in Google Sheets?
Membership unlocks 636+ 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.