Keyword research has always been the bedrock of successful SEO. It determines your audience’s intent, interests, and needs, allowing businesses to tailor their content to match user searches. But with millions of potential search queries and endless content flooding the internet, how can one efficiently and accurately tap into this vast ocean of opportunities?
That’s where RE2 regex comes in. Short for regular expressions, regex is a precise tool for drilling into data and extracting the patterns that matter. Plenty of SEOs know regex exists; far fewer use it to its full potential inside Google Search Console and Google Analytics. (Before you trust that query data, know how much of it Google hides.)
Key Takeaways
- RE2 is the regex flavor Google Search Console and Google Analytics use to filter queries, so learning it lets you slice your own performance data with precision.
- The fastest workflow: have ChatGPT translate plain-language intent (or an example pattern) into an RE2-valid pattern, then paste it into GSC’s “Custom Regex” filter.
- Seven ready-to-use patterns cover the highest-value cuts: TOFU/MOFU/BOFU intent, long-tail, seasonal, localized, and single-keyword monitoring.
- The payoff isn’t the patterns themselves; it’s what you do with the segmented data: spotting high-impression/low-click pages and the queries you rank for but haven’t optimized.
Regular Expression (Regex): A Definition
A regular expression, commonly abbreviated as regex, is a powerful tool used in computing for matching patterns in strings. It’s essentially a sequence of characters that forms a specific search pattern. When such a pattern is provided, the regex engine sifts through text to find matches, allowing for versatile string manipulation and complex text searches.
The beauty of regex lies in its flexibility and precision. It can be as straightforward as searching for a specific word in a document or as complex as extracting email addresses from a large body of text.
Some typical use cases for regular expressions include:
- Validation: Ensuring that inputs (like emails, phone numbers, or passwords) adhere to a specific format.
- Search: Locating specific sequences or patterns within a text.
- Replacement: Modifying strings based on specific patterns.
- Splitting: Breaking up a string based on delimiters that may not be consistent.
Languages and platforms that support regex (such as Python, JavaScript, Java, and many others) usually provide libraries or functionalities to work with regular expressions, allowing developers and data specialists to harness their capabilities.
While regex is undeniably powerful, it also demands precision. A poorly crafted regex can lead to inaccurate matches or miss data entirely. As such, mastering regular expressions often requires both practice and a keen understanding of its syntax and nuances.
RE2 Regex: Elevating Your SEO Game
RE2 Regex, a derivative of the general regular expression, brings a more efficient and safer way to handle regex operations. This is especially valuable for those who utilize tools like Google Search Console and Google Analytics, where the granularity of data can make or break your optimization strategies. Google Analytics regex patterns, for instance, allow users to filter and analyze traffic with a precision that traditional methods might miss. Similarly, the regex Google Search Console offers can refine your view of how users are reaching your site.
For those curious about the regex match mechanics, think of it as creating a custom sieve to filter data. When applied to keyword research, patterns like keyword-specific regex help zero in on high-impact terms. The result? Enhanced visibility into query strings, better content alignment with user intent, and, ultimately, a stronger digital presence.
The rest of this guide walks through practical regex examples for Google Analytics and Google Search Console, whether you’re new to regex patterns or refining what you already know.
How To Incorporate RE2 Regex Patterns in Google Search Console

Accessing Google Search Console
1. Navigating to the “New” Option
- Upon logging into your Google Search Console dashboard, go to Search Results which is found under performance, and identify and click on the “New” option, located at the top of the interface.

2. Engaging with the Query Functionality
- After clicking “New,” a dropdown menu will appear. Here, choose the “Query” option.
- This action will open up further choices. From these, select the “Queries containing” option, which allows for customized query searches.

3. Activating Custom Regex
- Within the query options, there will be a choice for “Custom Regex.” Opt for this to open a dialogue box where you can input your custom regex patterns.

Leveraging ChatGPT for RE2 Regex Creation
1. Introduction to Using Example Patterns
- Using the established examples is a recommended approach for those unfamiliar with regex patterns. This ensures accuracy and helps familiarize users with the structure of regex patterns.
2. Pasting Patterns in ChatGPT
- Access your preferred version of ChatGPT (3.5 or 4). Once the interface is open, paste the example pattern into the prompt box.
3. Running the Initial Prompt for Keyword Creation
- After pasting your pattern, run the prompt. ChatGPT will process the input and generate a response, usually providing you with a set of keywords or a refined pattern based on the given example.
4. Crafting the RE2 Regex Translation
- With the generated keywords or patterns from the initial run, enter the second prompt. This action will instruct ChatGPT to convert the content into an RE2 Regex pattern specifically tailored for Google Search Console.

Applying RE2 Regex Patterns in Google Search Console
1. Extracting the Generated Code
- Once ChatGPT completes the conversion, you will be presented with a code. Select and copy this code, ensuring not to alter or truncate any part of it.
2. Engaging with the “matches Regex” Pattern Section
- Navigate back to the Google Search Console interface. Inside the “Custom Regex” dialogue box you accessed earlier, find the section labeled “matches Regex.”
- Paste the copied RE2 Regex pattern into this section.
3. Witnessing the Results
- After inputting your pattern, click on the “Apply” button. If implemented correctly, and assuming there’s relevant data, you should notice a significant change in the metrics, including an increase in clicks and total impressions.
4. Identifying Question-Specific Queries
- The applied RE2 Regex will filter the queries to showcase those that align with the pattern provided. For instance, if the regex pattern targets question-based searches, the resulting display will prioritize queries that take the form of questions.
Regex Examples for Google Analytics and Google Search Console
Here are seven regex patterns to maximize keyword research:
1. TOFU (Top-of-Funnel) / Research Intent Keywords
Pattern:
^(what is|how|why is|history of|definition of|meaning of|explain|how does|overview|can)
Explanation: This pattern captures keywords that users typically enter when they’re in the research phase. Such queries are often geared towards understanding a concept or seeking broad information.
2. MOFU (Middle-of-Funnel) / Consideration Intent Keywords
Pattern:
^(best|advanced|techniques|strategies|reviews|on-page|checklist|insights|guide|how to)
Explanation: Targeting users in the consideration phase, this pattern catches queries where users are seeking more detailed insights, comparisons, or guides, indicating a deeper interest in a topic.
3. BOFU (Bottom-of-Funnel) / Decision Intent Keywords
Pattern:
^(vs|versus|alternatives|alternative|competitors|buy|price|purchase|deal|order|sale|discount)
Explanation: These keywords denote a user’s readiness to make a decision or purchase. The pattern captures queries where users are comparing options or are inclined towards buying.
4. Longtail Keywords
Long-tail keywords, typically longer and more specific, can be crucial for SEO as they often signal a user’s intent to make a decision or purchase. Capturing these keywords can enhance targeted marketing and content strategies.
Pattern:
(?:[^” “]*\s){4,}
Explanation: This pattern matches any line (or string) that consists of five or more words. Here, \w+ represents a word, and \W+ denotes spaces or non-word characters. The {4,} ensures that the pattern of “word followed by space/non-word characters” occurs at least four times, followed by another word, capturing phrases of five or longer.
5. Capture Seasonal Trends
Pattern:
^(summer|winter|spring|fall|holiday|christmas|black friday|halloween)
Explanation: Stay on top of seasonal trends and events with this pattern. It’s designed to capture queries about various seasons, major holidays, or shopping events.
6. Localised Queries
Pattern:
^(near me|philadelphia|baltimore|washington|newark|local|nearby|closest)
Explanation: Local SEO is paramount for businesses that cater to specific regions or cities. This pattern identifies queries that are localized in nature. For optimal results, swap out the cities to tailor the pattern to areas relevant to your website.
7. Queries Containing a Specific Keyword
Whether you want to monitor the performance of branded keywords or check the prevalence of a trending topic, having a pattern to detect specific keywords can be invaluable.
Pattern:
.*\bspecific-keyword\b.*
Explanation: Replace “specific-keyword” with the keyword you want to monitor. The \b in the pattern signifies word boundaries, ensuring that the keyword is captured as a whole word and not as a part of another word. The .* before and after the keyword ensures that the pattern matches lines where the keyword appears anywhere in the line.
For example, if you wanted to track the keyword “digital,” your pattern would look like this:
.*\bdigital-marketing\b.*
Making the Most of Your Keyword Data
With a trove of keyword data at your fingertips, the next challenge is to sift through it effectively. Here’s how you can convert raw keyword data into actionable insights:
1. Parsing Acquired Data
Parsing keyword data is more than just scanning numbers; it’s about identifying patterns, trends, and opportunities:
- Segmentation: Break down your keywords into categories, such as informational, transactional, navigational, etc. This will help you understand user intent.
- Time Analysis: Analyze the data over various periods (e.g., month-to-month or quarterly) to spot seasonality or emerging trends.
2. Spotting Unoptimized Keywords
Unoptimized keywords are like hidden treasures waiting to be discovered. They have good search volume but haven’t been utilized effectively:
- Gap Analysis: Compare your keywords against competitors. Tools like SEMrush or Ahrefs can be instrumental in this.
- High Impressions, Low Clicks: A keyword with a significant number of impressions but few clicks might indicate an optimization opportunity.
3. Integrating Keywords into Existing or New Landing Pages
Once you’ve pinpointed your keywords, take action:
- Optimization: Revise existing landing pages by incorporating these keywords naturally, ensuring content relevance and user intent alignment.
- Creation: If there’s no relevant landing page for a high-potential keyword, it might be time to create one. Ensure the content is rich, engaging, and answers the query effectively.
Conclusion
RE2 regex turns Google Search Console from a dashboard you glance at into a dataset you can interrogate. The patterns above are a starting kit; the real advantage comes from building your own for the questions specific to your site, then acting on what they surface. Most competitors never filter past the default view, which is exactly why it’s worth doing.
RE2 Regex in Search Console Checklist
- In Google Search Console, open Search Results under Performance and click the “New” option.
- Choose “Query,” then select “Custom Regex” to open the pattern box.
- Build your pattern with ChatGPT: paste an example RE2 pattern, run it, then ask ChatGPT to translate the result into an RE2 regex for Search Console.
- Copy the generated RE2 pattern exactly, without altering or truncating it.
- Back in the Custom Regex box, select “matches Regex,” paste the pattern, and click Apply.
- Review the filtered queries to surface the intent-specific terms, such as question-based searches, you are targeting.
Regular Expression FAQs
What is regex used for?
Regex, short for regular expressions, is a sequence of characters used to define a search pattern. It’s often employed in text searching, data validation, and text manipulation tasks.
What are the most common applications of regex?
Regex is commonly used in text editors for search-and-replace functions, data validation (like email format checking), string parsing, and in programming languages for text processing tasks.
Why should I learn regex?
Learning regex offers the ability to efficiently search, validate, and manipulate text data, making it invaluable for data-driven tasks, programming, and digital forensics.
Is Regex a useful skill?
Yes, Regex is an extremely valuable skill, especially for programmers, data analysts, and digital marketers, as it enhances text processing capabilities and data validation.
What is \d in Regex?
In regex, \\d represents any single digit from 0 to 9. It’s a shorthand for the character class [0-9].
What is \b in Regex?
In regex, \\b denotes a word boundary, which is a position between a word character (like a letter or digit) and a non-word character or the start/end of a string.
How do you match a string with regex?
To match a specific string using regex, you can use the exact sequence of characters. For example, to match the string “apple,” the regex pattern would be apple.
How do you match numbers in regex?
You can use the pattern \\d for single digits to match numbers in regex. You can use \\d+ for multiple digits, where the + denotes one or more repetitions of the preceding pattern.
Sources
Related reading: once you have your query data, learn how to find queries a page ranks for but isn’t optimized for.