You know the moment. A column of messy data lands in your sheet. You need one small piece out of it. So you open a new tab and search for the formula.
Twenty minutes later you have this pasted into B2:
=IFERROR(REGEXEXTRACT(A2, "^(?:https?:\/\/)?(?:www\.)?([^:\/\n?]+)"), "")It works. Sort of. It works until row 47, where somebody pasted a URL with no protocol. Then it works until row 112, where there is a trailing space. You wrap it in another IFERROR. You add a TRIM. The formula grows.
A week later you cannot read your own formula. Neither can anyone else on your team. And when the data format shifts slightly, the whole thing quietly returns the wrong answer instead of an error, which is worse.
This is the regex tax. You pay it every time your data is human-entered, which is almost always. This guide walks through the four categories of work where people reach for regex, and shows the plain-English alternative for each one.
Why Regex Breaks in Spreadsheets
Regex is a pattern matcher. It does not understand meaning. It matches characters in a sequence, and that is all it does.
That works beautifully when your data is uniform. Real spreadsheet data is not uniform. It came from a CSV export, a webform, a sales rep typing on a phone, and a client who uses their own conventions. Five different formats in one column is normal.
A pattern matcher has no fallback for that. It matches or it fails. So you write branch after branch to cover each variation, and the formula becomes a small unreadable program living inside a cell.
The alternative is to describe the outcome instead of the pattern. That is what FITS does. It adds a =FITS() function to Google Sheets that takes an instruction in English. You say what you want out of the cell. The AI figures out how to get it.
1. Extraction: Pulling One Piece Out of a Cell
This is the biggest regex category. You have a full string and you need a fragment. A domain from a URL. A zip from an address. A first name from a full name.
The old way. Every fragment gets its own pattern, and every pattern has edge cases you did not think of.
=REGEXEXTRACT(A2, "\d{5}(-\d{4})?")That pulls a zip code. It also happily pulls a five digit street number if the zip is missing. Nothing warns you.
The FITS way. Name the thing you want.
=FITS("Extract just the zip code from this address: " & A2)The same shape works for anything else buried in the cell.
=FITS("Get the phone number from this text, digits only: " & A2)We have written the step-by-step version of the most common extraction jobs: extracting the domain from a URL, separating first and last names, and pulling data from a website into Sheets.
2. Cleanup: Making Messy Data Consistent
Cleanup is where people lose whole afternoons. Phone numbers in six formats. Dates as text. Stray emojis. Double spaces. Names in RANDOM caps.
The old way. Standardizing a phone column means stripping every non-digit, then rebuilding the string by position.
=IF(LEN(REGEXREPLACE(A2,"\D",""))=10, "("&LEFT(REGEXREPLACE(A2,"\D",""),3)&") "&MID(REGEXREPLACE(A2,"\D",""),4,3)&"-"&RIGHT(REGEXREPLACE(A2,"\D",""),4), "")Four REGEXREPLACE calls on the same cell. Add a country code and it collapses.
The FITS way. State the format you want.
=FITS("Format this phone number as (XXX) XXX-XXXX: " & A2)The same approach handles the rest of the cleanup pile. Mixed date formats, special characters, inconsistent casing, all of it.
=FITS("Convert this to YYYY-MM-DD format: " & A2)=FITS("Remove all special characters and extra spaces from: " & A2)The key difference is tolerance. Regex fails on the row it did not expect. A plain-English instruction handles the outlier the same way a human would, by reading it and doing the sensible thing. Our guide to messy data extraction goes deeper on the cleanup workflow.
3. Text Manipulation: Rewriting What Is Already There
Sometimes you are not pulling data out. You are reshaping it. Cut everything after the @. Merge three columns. Remove one word from every row. Count how many times something appears.
The old way. Counting occurrences of a word in a range has no native function. So people use a SUMPRODUCT and SUBSTITUTE trick that measures how much shorter the text gets when you delete the word.
=SUMPRODUCT((LEN(A2:A100)-LEN(SUBSTITUTE(LOWER(A2:A100),"error","")))/LEN("error"))It works. It also takes ten minutes to explain, and nobody remembers why the division is there.
The FITS way. Ask for the count.
=FITS("Count how many times the word 'error' appears in this text: " & A2)Reshaping works the same way. You describe the edit rather than composing it out of LEFT, FIND, and SUBSTITUTE.
=FITS("Remove everything after the @ symbol in: " & A2)The full walkthrough is in how to count specific text in Google Sheets.
4. Categorization: The Thing Regex Simply Cannot Do
Here is where the comparison stops being fair.
You have 800 rows of customer feedback. You want each one tagged positive, negative, or neutral. Or you have a year of transactions and you want them sorted into expense categories. Or you have support tickets and you want the topic of each one.
The old way. There is no old way. Regex matches characters, so the best you can do is a keyword list, and a keyword list is a bad proxy for meaning.
=IF(REGEXMATCH(LOWER(A2),"great|love|awesome"),"Positive",IF(REGEXMATCH(LOWER(A2),"bad|hate|terrible"),"Negative","Neutral"))Feed it "not great, honestly" and it returns Positive. The pattern saw the word. It could not see the sentence.
The FITS way. This is the category where AI in the cell is not a shortcut, it is the only option.
=FITS("Classify the sentiment of this review as Positive, Negative, or Neutral: " & A2)=FITS("Categorize this transaction as Travel, Software, Meals, or Other: " & A2)Auto-tagging, keyword extraction, grouping similar rows, topic labelling. None of these have a native formula. They all take one line of FITS. If you want more ideas in this shape, see our AI formulas for content marketers collection.
But What About Smart Fill?
Fair question, and almost nobody writing about regex alternatives brings it up.
Google Sheets has a built-in machine learning feature called Smart Fill. You type one or two examples of the output you want in the next column. Sheets spots the pattern and offers to fill the rest. Press Tab and it does. No formula, no regex.
It is genuinely good, and you should use it. For simple, visually obvious extractions (first names out of emails, domains out of tidy URLs) it is the fastest path there is.
Here is where it stops. Smart Fill infers a pattern from your examples, so it has the same core limit as regex. It sees structure, not meaning.
- It cannot judge sentiment or categorize a transaction. There is no pattern to infer.
- It gets unreliable when the column has several competing formats.
- It gives you static pasted values, not a formula that updates when the source changes.
- It cannot fix what is actually wrong. It only reformats what is there.
That last one is the real gap. Say a row contains an email at "gamil.com". Regex will happily extract the typo. Smart Fill will happily copy the typo. Both did their job correctly. You still have bad data.
=FITS("Extract the email and correct any obvious domain typos: " & A2)Only a tool that understands what an email is supposed to look like can catch that. Pattern matchers cannot, by definition.
How to Set This Up (Step by Step)
- Install FITS from the Google Workspace Marketplace. It takes about thirty seconds.
- Open any Google Sheet. FITS appears under the Extensions menu.
- Add your API key (Gemini, OpenAI, or Claude). The getting started guide walks through it.
- Type
=FITS()in any cell, describe what you want, and reference the cell. - Drag the formula down the column like any other formula.
You can also pick the model and tune how creative the output is. Lower temperature means more predictable output, which is what you want for data work.
=FITS("Extract the company name from " & A2, "gemini-pro", 0.2)The free tier covers everyday use. If you are running formulas across thousands of rows, FITS Premium lifts the limits and unlocks the higher-end models.
Which Tool for Which Job
Being honest about this matters, because the wrong tool wastes your time either way. Regex is not the enemy. Using it for jobs it was never built for is.
| If your task is... | And the data is... | Use |
|---|---|---|
| Splitting on a comma or slash | Cleanly delimited | Data > Split text to columns |
| A simple visual extraction | Uniform, one obvious pattern | Smart Fill |
| Stripping non-digits, trivial matches | A system export that never varies | REGEXREPLACE |
| Extraction or cleanup | Messy, human-entered, mixed formats | =FITS() |
| Categorizing, tagging, sentiment | Anything | =FITS() (nothing else does this) |
Keep regex for uniform input and trivial patterns. It runs locally, it costs nothing, and it is fast. Reach for =FITS() when the data is human-entered, when formats vary, when the rule is easier to say than to encode, or when the job needs actual comprehension. That covers most real spreadsheets most of the time.
The Short Version
Regex asks you to describe the shape of your data. That only works if you already know every shape it will take. You never do.
Plain-English formulas ask you to describe the result instead. You always know that. It is why you opened the spreadsheet in the first place.
Stop Paying the Regex Tax
FITS puts plain-English AI formulas directly into Google Sheets. Describe what you want. Get the answer. Free tier included, no credit card.