The premise behind regex is fascinating: it lets you extract data from complex data sources using patterns, making that data more portable and useful.
But when I first learned about it, I wasn’t confident in my ability to write the code needed to make it happen. The fact that it relies on the careful and exact use of characters to get the specific information you need was more than a little intimidating for a non-coder.
But by establishing a foundation of knowledge, using built-in Zapier functionality, and plugging in AI assistants whenever I get stuck, regex has become a lot more accessible and useful across my work. Here’s how you can make it work for you too.
Table of contents:
What is regex?
Regex (short for regular expression) is an instruction for finding patterns in text.
For example, if you were looking for all the email addresses in a document, you might search for @
. Regex is just like this, just that you’re giving specific instructions to help the computer understand what the target text looks like. When you’re looking for data at scale, this is a lot more fun than Ctrl + F.
You can use regex to extract important details from emails, web pages, or any kind of text-based data source. For example, you could use regex to:
-
Find anything that looks like a phone number
-
Get every name that follows the text “Customer:”
-
Pull out all dollar amounts from an invoice
The power of regex is in both its flexibility and control. Say you have a long document and you want to extract phone numbers from it. By manually entering numbers, you might also encounter instances of page numbers or other irrelevant pieces of information. With regex, you can define that you’re looking for phone numbers in the format of 10 digits (123-456-7890).
I’m most familiar with using regex in Python, but it also works in multiple other coding languages, including but not limited to JavaScript, PHP, C++, and Ruby. Or, if you want to get the best of regex pattern matching without diving deep into the syntax, Zapier offers built-in text parsing features that use regex principles behind the scenes, making it accessible even if you’re not confident writing the expressions yourself.
The basics: Understanding regex patterns
Regex patterns are built from small components that combine to describe specific text structures. Here are some of the basic components.
Category |
Symbol |
Meaning |
---|---|---|
Character classes |
|
Matches any digit (0–9) |
|
Matches any word character (letter, digit, underscore) |
|
|
Matches any whitespace (space, tab, newline) |
|
|
Matches any single character (except newline) |
|
Quantifiers |
|
One or more of the previous character(s) |
|
Zero or more of the previous character |
|
|
Zero or one of the previous character |
|
|
Exactly 3 of the previous characters |
|
|
Between 2 and 5 of the previous character |
|
Grouping and position |
|
Groups characters together, treats them as a single unit |
|
Matches any one character inside the brackets (e.g., a, b, or c) |
|
|
Matches the start of a line |
|
|
Matches the end of a line |
With these building blocks, you can create powerful patterns. For example:
-
\w+
can match any complete word like “Bee,” “Zapier,” or “Constantine” -
\d{3}-\d{3}-\d{4}
matches phone numbers like 123-456-7890 -
[A-Z]\w+
matches words that start with a capital letter like “John,” but it won’t match “john” -
\$\d+
matches dollar amounts like $50 or $1,000
While it’s a bit advanced, you might also see patterns like (?:Mr\.|Ms\.)
.
-
?:
makes it a non-capturing group. In other words, the computer uses this grouped pattern to match the text, but it doesn’t store it separately. -
|
is used for “or.” So this pattern could be used while matching Mr. John or Ms. Aleen.
Practical regex patterns you can start using
Any AI chatbot can help you develop your regex patterns, but here are a few themes and examples you can use for inspiration.
Category |
Pattern |
Description / Example |
---|---|---|
Name extraction |
|
Basic two-part names (e.g., |
|
Complex names (e.g., |
|
|
Names with titles (e.g., |
|
Business data |
|
Invoice numbers (e.g., |
|
Order IDs (e.g., |
|
|
Product codes (e.g., |
|
Multiple instances |
|
Matches all URLs ( |
|
Phone numbers (flexible formatting) |
|
|
Email addresses |
|
Competitive analysis |
|
Pricing (e.g., |
|
Plan names in HTML headings (extracts from |
|
|
Extracts features from |
|
Advanced patterns |
|
Extracts text between |
|
Extracts the product ID following the label |
|
|
Matches currency formats in |
Automate regex with Zapier Formatter
You don’t really need to write scripts from scratch or tinker with APIs for extracting data. Zapier connects with 8,000+ apps, and with Formatter by Zapier, you can get the benefits of regex in a visual, no-code interface.

Formatter includes options to extract email addresses, URLs, phone numbers, and numbers. It can find those items from your text and then automatically store them somewhere (or even transform them into something else).
For complicated data extraction, you can choose Extract Pattern in Formatter by Zapier and actually enter a regex pattern to find specific data you’re looking for.

Zapier also offers several options to fine-tune your results:
-
Match All: Returns multiple results as line items instead of just the first match
-
MULTILINE: Allows patterns to work across multiple lines of text
-
DOTALL: Lets the dot (.) character match across line breaks
-
IGNORECASE: Makes patterns case-insensitive
You can also use clear labels, such as named capture syntax like (?P<firstname>\w+)
, to organize the extracted data.
Automate advanced regex tasks with Code by Zapier
Zapier’s Formatter gets the job done in most cases. But if you need more complex functionality, you can also use code inside your Zapier pipeline to automate your workflow.
You can use Code by Zapier to:
-
Combine multiple regex patterns with conditional logic
-
Process large text blocks with complex extraction rules
-
Create custom validation and data cleaning workflows
For example, you could use it to extract competitor pricing data, clean and standardize the format, and compare it to your pricing. Based on the results, you could then trigger different automation paths to send you an email, Slack message, or even adjust pricing dynamically.
And with Zapier’s AI Copilot, you don’t even need to be a coder to make it happen.
Learning resources
This guide just scratches the surface when it comes to understanding regex. Here are some of my favorite resources for learning more.
Related reading: