Google Sheets tool
REGEXREPLACE formula generator
Describe what you want to change, paste an example string, and get a ready-to-paste
=REGEXREPLACE()
formula for your sheet.
Three fields. One click. Copy the formula straight into your cell.
Build your formula
Recipe library
REGEXREPLACE examples for Google Sheets
Real patterns for CRM cleanup, SEO slugs, YouTube IDs, and scraped HTML. Load any card into the generator at the top of this page, or copy the formula directly into your sheet.
13 ready-made patterns. Click Load in generator to pre-fill the form.
Clean Phone Numbers for CRM Imports
People enter phone numbers in inconsistent formats.
Before (cell A1)
-
+1 (555) 123-4567 -
555.123.4567 -
555-123-4567 ext 89
After
-
15551234567 -
5551234567 -
555123456789
Formula
=REGEXREPLACE(A1,"[^0-9]","")
Extract YouTube Video IDs from URLs
Extract video IDs from different YouTube URL formats.
Before (cell A1)
-
https://www.youtube.com/watch?v=dQw4w9WgXcQ -
https://youtu.be/dQw4w9WgXcQ
After
-
dQw4w9WgXcQ
Formula
=REGEXREPLACE(A1,".*(?:v=|be/)([a-zA-Z0-9_-]{11}).*","$1")
Remove HTML Tags from Scraped Content
Remove HTML tags from scraped website content.
Before (cell A1)
-
<h1>Best Coffee Shops</h1><p>Bali has amazing cafes.</p>
After
-
Best Coffee ShopsBali has amazing cafes.
Formula
=REGEXREPLACE(A1,"<[^>]+>","")
Convert Titles into SEO-Friendly URL Slugs
Turn messy titles into clean URL slugs.
Before (cell A1)
-
10 Best Cafes in Bali
After
-
10-best-cafes-in-bali
Formula
=REGEXREPLACE(LOWER(REGEXREPLACE(A1,"[^a-zA-Z0-9]+","-")),"(^-+|-+$)","")
Remove Emojis from Imported Data
Strip emojis from text before importing into systems.
Before (cell A1)
-
🔥 HUGE SALE TODAY 🚀
After
-
HUGE SALE TODAY
Formula
=REGEXREPLACE(A1,"[^\x00-\x7F]","")
Extract Email Addresses from Text
Find and extract email addresses from text.
This pattern uses REGEXEXTRACT; load it in the generator to adapt for your sheet.
Before (cell A1)
-
Contact us at support@bettersheets.co for help.
After
-
support@bettersheets.co
Formula
=REGEXEXTRACT(A1,"[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Za-z]{2,}")
Remove Duplicate Spaces from Text
Fix messy spacing from copied or imported text.
Before (cell A1)
-
Andrew Kamphey
After
-
Andrew Kamphey
Formula
=TRIM(REGEXREPLACE(A1,"\s+"," "))
Extract Domain Names from URLs
Pull only the domain name from full URLs.
Before (cell A1)
-
https://www.bettersheets.co/tutorials/google-sheets
After
-
bettersheets.co
Formula
=REGEXREPLACE(A1,"https?://(www\.)?([^/]+).*","$2")
Turn Line Breaks into Comma-Separated Lists
Convert multi-line text into comma-separated values.
Before (cell A1)
-
Apple Banana Orange
After
-
Apple, Banana, Orange
Formula
=REGEXREPLACE(A1,"\n",", ")
Strip Tracking Parameters from URLs
Remove UTM tracking parameters from URLs.
Before (cell A1)
-
https://example.com/page?utm_source=twitter&utm_campaign=sale
After
-
https://example.com/page
Formula
=REGEXREPLACE(A1,"\?.*","")
Extract Hashtags from Social Posts
Pull hashtags from social media content.
Before (cell A1)
-
New video today! #GoogleSheets #Automation #NoCode
After
-
#GoogleSheets #Automation #NoCode
Formula
=REGEXREPLACE(A1,".*?(#\w+(?:\s+#\w+)*).*","$1")
Normalize Product SKUs
Clean and standardize messy SKU codes.
Before (cell A1)
-
SKU: ab-123_xy!
After
-
SKUAB123XY
Formula
=UPPER(REGEXREPLACE(A1,"[^A-Za-z0-9]",""))
Clean AI Output Before Publishing
Replace AI-generated bullet symbols with standard formatting.
Before (cell A1)
-
Here's your answer: • Item one • Item two • Item three
After
-
Here's your answer: - Item one - Item two - Item three
Formula
=REGEXREPLACE(A1,"[•]+","-")
Formula generator hub
Build the exact Google Sheets formula you need, faster and with fewer retries
Pick a specialized generator below, describe what you need in plain language, and get a paste-ready formula with the right structure from the start.
General Builder
Formula Generator
Turn plain-English tasks into complete formulas when you are not sure which function to start with.
Generate multi-function formulas
Data Filtering
QUERY Generator
Create SQL-style filters, sorting, grouping, and limits without memorizing QUERY syntax.
Build reports in minutes
Mini Charts
SPARKLINE Generator
Design in-cell charts for trends, win rates, and progress bars with cleaner defaults and options.
Visualize trends instantly
Pattern Checks
REGEXMATCH Generator
Test whether cells contain valid patterns like emails, IDs, prefixes, and naming conventions.
Validate messy data fast
Pattern Cleanup
REGEXREPLACE Generator
Strip unwanted text, normalize formatting, and re-shape imported data with precise replacements.
Clean text at scale
Need unlimited generations across every tool?
Upgrade once, skip usage limits, and move from idea to final formula without stopping.
Watch REGEXREPLACE in action
Real walkthroughs: cleaning messy strings, stripping HTML, swapping line breaks, and more.
Browse tutorialsAbout the formula
REGEXREPLACE(text, regular_expression, replacement)
matches a pattern in text and swaps it for something new—ideal when find-and-replace is not enough.
Syntax, examples, and member tutorials live in the formula directory.
Open reference