Why Use a Regex Tester for GA4?
Regular expressions let you filter many pages, campaigns or search queries with one rule. They power GA4 report filters, audiences, custom channel groups and the Search Console performance report. The catch is that each tool reads them a little differently, and a regex that works in a code editor can quietly fail in Google's tools.
This tester copies Google's behaviour. GA4 matches regex is a full match and case sensitive by default, as explained in Google's regular expressions help page. Search Console uses RE2, matches anywhere in the text and ignores case unless you start with (?-i), according to its filtering documentation.
How to Use the Tester
- Choose where the regex will be used: GA4 full match, GA4 partial match, or Search Console.
- Type your regex and paste the values you want to check, one per line. Real page paths or queries from a report work best.
- Read the results. Matching rows are highlighted, and in partial mode the matching part is marked.
- Fix any warnings, such as lookaheads that Google's RE2 engine does not support.
- Use the list builder to turn a plain list of pages or keywords into a safe, escaped regex.
Regex Cheat Sheet for Analytics
| Pattern | Meaning | Example |
|---|---|---|
| | Or | seo|ppc |
.* | Anything, any length | /blog/.* |
^ and $ | Start and end of the value | ^/blog/$ |
( ) | Group options together | /(en|hi)/pricing/ |
\. | A real dot, not any character | thank\.html |
[0-9]+ | One or more digits | /p/[0-9]+ |
? | The item before it is optional | colou?r |
(?i) | Ignore case (Search Console style) | (?i)brandella |
Tips for Google Regex Filters
- Mind full match in GA4. With matches regex,
/blog/only matches that exact page. Add.*or switch to partially matches regex to catch every blog post. - Escape dots and question marks in URLs. The list builder does this for you.
- Avoid lookaheads. RE2 has no lookarounds or backreferences. Use the does not match option instead.
- Watch capitals. GA4 is case sensitive, so
/Blog/and/blog/are different values.
Put Your Regex to Work
Use regex to separate brand searches with the branded queries filter in Search Console, dig into the Search Console performance report, and clean data as shown in how to detect and filter bot traffic in GA4. Want clean campaign values to filter on? Build them with the UTM builder.
Frequently Asked Questions
1What regex syntax does GA4 use?
Google Analytics and Search Console use Google's RE2 syntax. It supports the common patterns like |, .*, ^, $, groups and character classes, but not lookaheads, lookbehinds or backreferences.
2What is the difference between matches regex and partially matches regex in GA4?
Matches regex must match the whole value. Partially matches regex passes if any part of the value matches. For example, seo fully matches only the value seo, but partially matches /blog/seo/tips/.
3Is Search Console regex case sensitive?
No. Search Console regex ignores case by default. Start your expression with (?-i) to make it case sensitive.
4Is my data sent anywhere?
No. All testing runs in your browser and nothing you paste is uploaded.