GA4 Regex Match Types — Matches Regex vs Partially Matches Regex
Google Analytics 4 exposes four regex match types — but the exact dropdown you get depends on where you are filtering. This page maps which GA4 surface offers which match type, shows what full match and partial match actually do to your results, and gives you the one-line conversion between the two patterns so you never paste a filter that silently returns nothing.
TL;DR: matches regex = your pattern must cover the entire value; partially matches regex = your pattern only has to occur somewhere inside it. Partial is offered in standard report filters and custom channel groups; explorations, segments and audiences are full-match only. Convert by adding or removing .* on both ends.
The four GA4 regex match types
| Match type | What GA4 does with your pattern | Pattern blog against /blog/post-1 |
|---|---|---|
| Matches regex | Full match — the pattern must match the whole value start to finish | no match |
| Partially matches regex | Substring match — the pattern may occur anywhere in the value | match |
| Does not match regex | Full match, then inverted — keep values the pattern covers completely | excluded |
| Does not partially match regex | Substring match, then inverted — drop any value containing the pattern | excluded |
Google documents the same default in About regular expressions: GA4 regex is full match and case sensitive by default — partial matching requires metacharacters such as .*. The four options above are simply that rule made selectable.
Where each match type is available
This is the part that causes the confusion: the same pattern behaves differently because different screens offer different operators. GA4 updates its interface regularly, so treat this as the current map with a safe fallback — if an option is missing, assume full match.
| GA4 surface | Regex match types offered | Matching |
|---|---|---|
Standard reports — + Add filter on a detail report |
matches regex · partially matches regex · does not match · does not partially match | full & partial |
| Custom channel groups (Admin → Channel groups) | matches regex · partially matches regex (and their inverses) | full & partial |
| Explorations — Free form and other exploration filters | matches regex · does not match regex only | full match only |
| Segments & audiences (condition builders) | matches regex · does not match regex only | full match only |
| Create / modify events (Admin → Events) | matches regex on event name and parameters | full match only |
Comparisons (Add comparison in a report) |
No regex option — exactly matches / contains / begins with / ends with only | n/a |
| GA4 Data API (programmatic filters) | FULL_REGEXP and PARTIAL_REGEXP match types |
full & partial |
The practical rule: if you only see “matches regex”, write the full-match form (.*value.*). It works everywhere — the extra wildcards are harmless in the screens that also offer partial match. One extra constraint in standard report filters: regex there is case sensitive and capped at 250 characters.
Converting between full-match and partial-match patterns
Every row shows the same intent written twice: the partial form (for screens that offer partially matches regex) and the full-match form (for explorations, segments, audiences and event rules). Load either into the tester and watch the highlighted matches.
Contains / starts with / ends with
| You want | Partial form | Full-match form | |
|---|---|---|---|
Value contains blog |
blog |
.*blog.* |
Try in tester → |
Path starts with /blog/ |
^/blog/ |
/blog/.* |
Try in tester → |
Path ends with .pdf |
\.pdf$ |
.*\.pdf |
Try in tester → |
| Value contains “checkout” | checkout |
.*checkout.* |
Try in tester → |
OR-lists and exclusions
| You want | Partial form | Full-match form | |
|---|---|---|---|
| Source is one of three social networks, anywhere | facebook|instagram|linkedin |
.*(facebook|instagram|linkedin).* |
Try in tester → |
| One of three event names, exactly | ^(purchase|begin_checkout|add_to_cart)$ |
^(purchase|begin_checkout|add_to_cart)$ |
Try in tester → |
| Exclude admin paths (paired with “does not match”) | ^/admin/ |
^/admin/.* |
Try in tester → |
| Campaign traffic from newsletter or partner | newsletter|partner |
.*(newsletter|partner).* |
Try in tester → |
Anchored patterns like ^(purchase|…)$ are identical in both modes: ^ and $ already pin both ends of the string, so nothing is left for the match type to decide.
One nuance: this tester matches like JavaScript (partial), GA4 defaults to full
RegexLab runs your browser’s native JavaScript RegExp engine, which searches for a match anywhere in the test string — the same behaviour as GA4’s partially matches regex. GA4’s default everywhere else is full match. So when you preview a pattern for an exploration or a segment, anchor it yourself: type ^/blog/$ or use the full-match column above. If /blog/ matches /blog/post-1 here but you need GA4’s full-match verdict, the anchors tell you the truth instantly.
Two further differences worth keeping in mind when you move a pattern from this tester into GA4: GA4 runs RE2, so lookahead, lookbehind and backreferences are rejected silently — see RE2 vs PCRE for every unsupported construct and its replacement — and every GA4 filter is case sensitive, so /Blog/ never matches /blog/ unless you write [Bb]log.
Which pattern should I write? A quick decision list
- Screen shows “partially matches regex” → short pattern, no wildcards:
blog,facebook|instagram. - Screen shows only “matches regex” → wrap it:
.*blog.*,.*(facebook|instagram).*. - You need an exact list of values → anchor both ends:
^(a|b|c)$— works in both modes. - You need “contains X but not Y” → two filters (include + exclude), not a negative lookahead — RE2 has none.
- The dropdown has no regex at all (comparisons) → use a report filter, an exploration, or a segment instead.
- You’re unsure what the pattern really matches → run it here first against sample values, then paste it into GA4.
FAQ
What is the difference between matches regex and partially matches regex in GA4?
Matches regex requires the pattern to cover the entire value (full match); partially matches regex only requires it to occur somewhere inside. blog matches only the exact value “blog” in the first case, and any value containing “blog” in the second.
Where can I use partially matches regex in GA4?
In standard report filters (+ Add filter) and in custom channel groups. Explorations, segments, audiences and event conditions give you matches regex only — full match. If the option is missing, assume full match and add .* at both ends.
Why does my regex work in one report but return nothing in another?
Because the two screens use different match types. A bare blog works under partially matches regex but returns zero rows under full match. Rewrite it as .*blog.* and it behaves the same everywhere.
Can I use regex in a GA4 comparison?
No. The comparison builder only offers string operators (exactly matches, contains, begins with, ends with). Rebuild the condition in an exploration, or apply a report filter instead.
Is GA4 regex case sensitive?
Yes — every match type is case sensitive. Cover the variants explicitly, for example (?:[Bb]log) or [Ff]acebook.
Ready-made patterns for each match type live in the GA4 regex cheat sheet. For path-specific filters see the GA4 page path regex guide, for event-name rules the GA4 event filter regex guide, for channel-group rules the GA4 custom channel grouping regex guide, and for engine limits the RE2 vs PCRE reference.