Analytics and measurement
GA4 Regex Tester with RE2 Checks
Test a regular expression against your own values the way GA4 reads it, with warnings for syntax that GA4 will reject.
Runs in your browser; nothing is uploaded. · Free, no account · 3 min
Importing a saved run into your account is coming soon. Until then, your last runs stay in this browser only, and you can download your files.
How to use
- Type or paste your regular expression.
- Paste the values you expect it to match or not match, one per line.
- Choose matches regex (the whole value) or matches partial regex.
- Read the table and the warnings, then confirm the final pattern inside GA4.
What it checks and how it works
Google's regex page says GA4 regex is a full match by default and case sensitive, and that a partial match needs metacharacters such as .*; its report-filter page says regular expressions are limited to 250 characters. The tester follows those rules: in whole-value mode it anchors your pattern at both ends, and it shows the pattern length against 250.
GA4 evaluates patterns with RE2, which has no lookahead, lookbehind, backreferences or possessive quantifiers. This tester runs your pattern with your browser's JavaScript engine, which accepts some of those. So it scans the pattern for the RE2 differences it can detect and warns about them, and notes RE2-only syntax such as (?i) flags and POSIX classes that it cannot fully run. It cannot prove that a pattern works in GA4, so confirm the final version in GA4.
Sources
- Google Analytics Help: About regular expressions (regex) opened 29 Oct 2026
- Google Analytics Help: Apply filters to detail reports (regex limit) opened 29 Oct 2026
- RE2 regular expression syntax opened 29 Oct 2026
Related tools
GA4 AI Referral Regex Builder
Build the regex that matches AI-assistant sources in Google Analytics 4, and test it on the values in your own reports.
GA4 Custom Channel Group Guide for AI Traffic
Get the exact steps, with your regex filled in, to see AI-assistant traffic as its own channel in GA4.
GA4 Event Name Validator
Paste your planned event names and see which break Google's rules before they reach your tracking code.
UTM Parser and Campaign URL Auditor
Paste campaign URLs and see every utm parameter in a table, with the problems that split your reports flagged.
Go further with Zaher: See AI-assistant traffic next to your other channels
Questions
About this tool
Often because it uses a lookahead, lookbehind or backreference that RE2 does not support, or because GA4 matches the whole value and the pattern matched only part of it. This tester warns about both.
By default yes, according to Google's regex page. The tester has an ignore-case switch to help you compare, but GA4 report filters do not ignore case, so write the pattern to match the capitalisation in your data.
Google's report-filter page says regular expressions are limited to 250 characters. If your pattern is longer, split the values across two filters or two channels.
Get started today
Find out where your brand stands in AI. Free.
Run a free AI visibility analysis on your domain. No credit card, results in minutes. See what AI engines say about your brand today.
Brands already measuring their AI visibility with Zaher.


