Free tool

GA4 Regex Tester

Type your regular expression and the values to test: the tool compares them the way GA4 does, as a full match and case sensitive, then flags what the RE2 syntax does not support.

By default, a Google Analytics regex has to match the whole value, capitals included: “San Francisco” only returns “San Francisco”, while “.*San Francisco.*” also returns “South San Francisco”. A GA4 audience condition stops at 500 characters.

Match type

The expression must cover the whole value: /blog does not match /en/blog/google-ads.

Result

-

      Expression tested:

      Sources read on November 6, 2026: Google Analytics Help, regular expressions and RE2 syntax.

      Your Filters Are Right. Does Your GA4 Measure What Matters?

      A correct regex cannot make up for a shaky setup: I check the events, conversions and audiences of your GA4 property, and fix what skews your reports.

      20 minutes · No commitment · 100% confidential

      Step 1 Of 2 · Your Project

      Step 2 Of 2 · Your Details

      Who are these campaigns for? *
      What are you looking for in our collaboration? * You can pick several
      Where do your ad campaigns stand today? *
      When would you ideally like to start? *

      How GA4 reads a regular expression

      Full match: ^(?:your expression)$ · partial: your expression, anywhere in the value

      By default, Google Analytics compares the expression with the whole value: without .* at the start and end, /blog matches neither /blog/google-ads nor /en/blog. The tool reproduces this by wrapping your expression in ^(?: and )$, and the Partial option removes that constraint.

      Capitals count by default too: /Blog/meta-ads does not match /blog/.*. In GA4, explorations are case sensitive, while the search field in reports is not: untick the box to test that second case.

      The Google Analytics help points to the RE2 syntax, which rejects several constructs accepted elsewhere: lookaheads and lookbehinds, backreferences, atomic groups, possessive quantifiers. The tool flags them before GA4 rejects them or returns an empty result.

      Where to test your regex before using it

      • A group of pages: check that an expression catches every URL in a section, and nothing else, before you use it in a filter or an exploration.
      • An audience: a GA4 audience condition is limited to 500 characters. The tool counts your expression’s length and warns you beyond that.
      • Traffic sources: group the variants of a source or of your UTM parameters, such as facebook, Facebook and m.facebook.com, into a single expression.

      Frequently asked questions

      Why doesn’t my regex work in GA4?

      Most often because GA4 uses a full match: the expression has to cover the whole value. Add .* at the start or end, or test in Partial mode to see the difference. Next come capitals, and the constructs the RE2 syntax does not support.

      Is GA4 regex case sensitive?

      By default, yes: the Google Analytics help states that its regular expressions are case sensitive. The search field in reports is the exception: it is not case sensitive.

      What about event modification rules?

      They run in JavaScript in the browser, not in RE2: lookaheads, lookbehinds and backreferences are accepted there. Google also offers an option that ignores case for them.

      What is the maximum length of a GA4 regex?

      The only published limit the tool found applies to audiences: 500 characters per condition. The Google Analytics help gives none for other uses.

      Théo Maupilé

      Growth partner

      Positioning, acquisition, innovation: together we build a lasting growth system.

      Théo MaupiléFreelance Paid Media

      Google PartnerSuperMalter

      ◉ Certifications

      Official Google Partner
      & SuperMalter