Products SEO & GEO Agent Paid Ads Agent Website Agent Conversion Agent
How it works Pricing FAQ Blog Book a call

Regex generator for Search Console and GA4 filters

Updated · 6 min read

Short answer You rarely need a separate regex generator. Search Console's experimental AI configuration (if you see it) or any AI chatbot can write the pattern, and regex101's free tester checks it. Tell the tool where it goes: Search Console matches anywhere in a query and ignores capitals; GA4 must match the whole value and counts capitals.

Want help applying this to your business? Talk it through on a free 30-minute call.

Book a call

Which regex generator to use

You don't need a dedicated generator. A regex (regular expression) is a short pattern that matches many pieces of text at once, such as every search that names one of your towns. The routes below cover what a small business needs; the hard part is telling the tool which product the pattern is for.

RouteCostGood forLimits
Search Console's AI-powered configurationFree, inside Search ConsoleDescribe the report you want in plain words; it can add a regex filterExperimental; Google says only a small share of users see it; 20 requests a day; Search results Performance report only
An AI chatbot (ChatGPT, Gemini, Claude)Your existing planAny pattern, for either toolDoesn't see your data; may use syntax Search Console rejects
regex101.comFree tester; explanations and its AI assistant need ProTesting a pattern on real searches or page pathsChoose the Golang flavor to match Search Console's rules
By hand, from the lists belowFreeBrand, towns, questions, page sectionsA few symbols to learn

To use Google's tool, click the filter icon at the top of the Performance report, type a request and confirm the filters it suggests. In Google's own example, "queries that include common animal names" became a query filter matching a regex. Google adds:

"Since this is an AI feature, the tool may generate filters that don't match your request. Always review the filters applied to the report to ensure they match your intended query." (Search Console Help: Performance report, advanced filtering and comparison)

Search Console vs GA4: why the same pattern fails

They read patterns differently, so a pattern that works in one can return nothing in the other.

Search ConsoleGA4
What must matchAny part of the query or URLThe whole value
Capital lettersIgnored by defaultCount by default
Where you type itPerformance report: Queries or Pages filter, Custom (regex)Data filters, key events, segments, audiences, content groups, custom channel groups

Search Console's help page states the first rule:

"Default matching is a "partial match." Your regular expression can match anywhere in the target string unless you use ^ (start of string) or $ (end of string)." (Search Console Help)

GA4 is the opposite. Google's Analytics help says GA4 regex is a full match and case-sensitive by default: the pattern India matches only "India", and India.* matches any value that starts with India. So to move a Search Console pattern into GA4, add .* at both ends: (plano|frisco) becomes .*(plano|frisco).*

Two symbols trip everyone in both tools. A dot means "any character" and a question mark means "the character before is optional", per Google's RE2 syntax reference. To mean a real dot or question mark, put a backslash before it: example\.com, \?

Search Console regex patterns to copy

In the Performance report, click + Add filter, choose Queries or Pages, then Custom (regex). For several values, Google's help says to separate them with a vertical bar and wrap the whole thing in parentheses. Swap in your own words:

  • Searches without your business name (Queries, choose Doesn't match regex): (bluestone|blue stone|bluston)
  • Questions: ^(how|what|why|when|where|who|can|does|is)\s
  • Price shoppers: (cost|price|how much|cheap|quote|estimate)
  • Towns you serve: (plano|frisco|allen|mckinney)
  • Long, conversational searches (six words or more): (\S+\s+){5}\S
  • One section of your site (Pages): /services/
  • Several pages at once (Pages): /(drain-cleaning|water-heater-repair)/
  • Everything except the blog (Pages, Doesn't match regex): /blog/

For the brand pattern, Google's tip:

"Use regex that specify multiple variants of your company name, including misspellings." (Google Search Central Blog, June 2021)

Before you write one, check the query filter for Branded and Non-branded. Google's branded filter is "determined by an internal, AI-assisted system" and works only for top-level properties (not a URL path or subdomain) with enough queries and impressions. Since March 11, 2026, every eligible site has it. If yours doesn't, use the pattern above.

GA4 regex patterns to copy

Pick "matches regex" as the condition, for example in a custom channel group. Every pattern must cover the whole value:

  • All service pages (page path): /services/.*
  • Thank-you pages, for a lead segment or audience (page path): /(thank-you|thanks|booking-confirmed)/?
  • Visits from AI assistants (source, in a custom channel group): .*(chatgpt|perplexity|gemini|copilot|claude).*
  • Facebook, any capitalization (source): .*[Ff]acebook.*

How to get a chatbot to write a regex that works

Tell it the product and its rules, or it guesses. Give it these four lines:

  1. "Write a regular expression for a Google Search Console query filter. It uses RE2 syntax, matches anywhere in the query and ignores capital letters."
  2. "Match searches containing: [your words, misspellings, towns]."
  3. "Don't use lookaheads, lookbehinds or backreferences."
  4. "Give me 5 searches it should match and 5 it shouldn't."

For GA4, change the first line to: "Write a regular expression for a Google Analytics 4 'matches regex' condition. It must match the whole value and is case-sensitive."

Then scan the answer. RE2's syntax reference marks these NOT SUPPORTED, so Search Console can't run them:

  • (?= or (?! — lookaheads, meaning "followed by" or "not followed by"
  • Lookbehinds, which open with (? and a less-than sign
  • \1 or \2 — backreferences, meaning "the same text again"

If the chatbot used a lookahead to leave something out, delete that part and choose Doesn't match regex instead.

How to test a regex before you trust the numbers

  1. Apply it and read the rows. Every query or page shown should belong.
  2. Flip it. In Search Console, switch to Doesn't match regex and scan the top rows for what you meant to catch, such as a misspelled brand name.
  3. Test outside the report when it matters, for example before building a GA4 audience. Paste the pattern and 20 real values, one per line, into regex101's free tester and choose the Golang flavor: Go's regexp package accepts "the syntax accepted by RE2", per its documentation. For Search Console, start the pattern with (?i) to ignore capitals. For GA4, wrap it as ^(...)$ to demand a whole-value match.
  4. Don't expect filtered rows to add up. Search Console says filtering by query or URL can change report totals, because of data truncation and anonymized queries.

Example

Illustrative cases with invented numbers.

A plumber in Texas splitting brand searches from the rest

Bluestone Plumbing had 900 clicks in three months. Query filter, Doesn't match regex, (bluestone|blue stone|bluston): 350 clicks remain. Those came from people who didn't search for the name: the number SEO work is meant to grow.

A physiotherapy clinic in Toronto checking its neighbourhoods

The query filter (etobicoke|mississauga|north york) shows 40 clicks in three months, nearly all to the homepage. No page speaks to those areas yet.

A dental office whose GA4 segment showed zero

The office manager typed thank-you with "matches regex" on page path. GA4 needs the whole value, and the real path is /thank-you/, so nothing matched. /thank-you/? fixed it: 25 form leads last month.

FAQ

Is there a free regex generator for Google Search Console?

Yes, if your account shows it: Search Console's AI-powered configuration writes filters from plain words, 20 requests a day. Otherwise ask any AI chatbot, then test the result in regex101 with the Golang flavor.

Why does my GA4 regex return no data?

Check three things. GA4 matches the whole value, so add .* at both ends; it counts capital letters; and a dot matches any character unless you put a backslash before it.

Can I use a lookahead in Search Console?

No. Search Console uses RE2, which doesn't support lookaheads, lookbehinds or backreferences. To leave queries out, choose Doesn't match regex.

Do I still need regex for branded searches?

Only if Search Console doesn't show you its Branded and Non-branded filter. Google offers it to top-level properties with enough queries and impressions.

Different for you?

Keep learning

NextGoogle Analytics for local SEO: calls, directions and townsSet up GA4 for local SEO: link your Business Profile, tag its website link, see visitors by town, and count calls and direction clicks.

Ask us one question

One line is enough. We reply by email.

Sources

  1. Search Console Help: Performance report (Search results): Advanced filtering and comparison
  2. Google Search Central Blog: Streamline your Search Console analysis with the new AI-powered configuration (December 2025)
  3. Google Search Central Blog: Search Console regex filters update and quick tips (June 2021)
  4. Google Search Central Blog: Introducing the branded queries filter in Search Console (November 2025, updated March 2026)
  5. RE2 (Google): Syntax reference
  6. Analytics Help: About regular expressions (regex)
  7. Analytics Help: Custom channel groups
  8. Go documentation: package regexp
  9. regex101: Online regex tester
  10. regex101 docs: regex101 Pro, compare free and Pro