Airtable recently added the option to use regular expressions in the formula field. It went under the radar but it’s a pretty big deal!
So first, what are regular expressions?
Regular expressions are a way to search for patterns in strings or text. You may be familiar with text functions in formulas in Airtable (and their equivalencies in sheets) such as “Find”, “Left”, “Mid” etc. These text functions help you (find), extract (left, right, mid) or replace (replace) substrings. This is extremely useful in sanitizing data, formatting strings the way you need them etc.
They can help you answer questions like “Is there an @ in this email address” or “give me every letter until the first space”?
You’ll notice that in each of these formulas, you need to input the substring you’re looking for (or use a combination of “length” and “find” to extract substrings).
With those functions, it’s not possible to know whether a pattern is present. You can’t identify something like “Is there text between two dots?” or “Is this URL valid?”. With regex you can identify, replace or extract based on string patterns.
For instance, you can say “are the letters a,b,c present separated by at most one character” as seen here: