Search Console regex library: 44 tested patterns

Checked 18 November 2026. 44 regular expressions for Google Search Console, GA4 and Looker Studio. Every one was tested in Google's RE2 engine, the one Search Console and GA4 run, against the examples shown on its card. Copy a pattern, or paste your own into the tester at the bottom.

Three rules before you paste anything

Search ConsoleGA4 report filters
EngineRE2RE2
Default matchPartial: the pattern can match anywhere unless you use ^ or $'matches regex' must match the whole value. Use 'matches partial regex' for contains
CaseIgnores case by default. Start with (?-i) to make it case-sensitiveCase-sensitive
LengthNo limit stated by Google250 characters
Not supportedLookaheads, lookbehinds, backreferencesSame

Sources: Google's Search Console help on regex filters and GA4 help on report filters, both read 18 November 2026. In Looker Studio, REGEXP_MATCH needs the whole value to match and REGEXP_CONTAINS matches anywhere.

The library

Test a pattern

Paste a pattern and some sample queries or URLs, one per line. Lines that match are highlighted. Runs in your browser; nothing is sent anywhere.

    The tester uses your browser's regex engine with the same flags. Every pattern in this library uses only syntax that behaves the same in RE2 and in the browser. Lookaheads, lookbehinds and backreferences work here but fail in Search Console and GA4, so the tester warns you about them.

    The syntax you need

    SymbolMeaning
    .Any one character
    * + ?Zero or more, one or more, optional
    ^ $Start and end of the text
    |Or
    \Treat the next character literally, so \. is a real dot
    [^/]+One or more of anything except a slash
    \b \s \SWord boundary, a space, anything but a space

    Screaming Frog, most code and most redirect rules use Java or PCRE-style engines, not RE2. Lookaheads work there. Test a pattern in the tool you will run it in.

    Two more for crawl and log work

    Pages exactly one level deep (edit the domain). Works in Search Console's Page filter:

    ^https://(www\.)?example\.co\.uk/[^/]+/?$

    AI crawlers in server logs. Most log tools accept this; drop the (?i) if yours does not:

    (?i)(GPTBot|ChatGPT-User|OAI-SearchBot|ClaudeBot|Claude-User|PerplexityBot|CCBot|Bytespider)

    Google-Extended is a robots.txt token, not a user agent, so it never appears in logs. User agents can be faked: a match shows what a request claimed to be. Check it against the crawler's published IP ranges before you trust it. More in AI crawlers explained.

    Mistakes that return nothing

    • Pasting a GA4 pattern into Search Console or the other way round. GA4's 'matches regex' needs the whole value, so /blog/ matches nothing there. Use /blog/.* or switch to 'matches partial regex'.
    • Writing full URLs in GA4. GA4 stores the page path (/blog/post/), not https://example.co.uk/blog/post/.
    • Using a lookahead such as (?!brand) to exclude something. RE2 rejects it. Use the Doesn't match regex option with a plain pattern instead.
    • Forgetting to escape dots. example.co.uk also matches exampleXcoXuk. Write example\.co\.uk.
    • Assuming Search Console is case-sensitive. It is not, unless you start the pattern with (?-i).

    How these were checked

    Each pattern was compiled and run in Google's RE2 library (the google-re2 Python bindings) on 18 November 2026. Search Console patterns were run as partial, case-insensitive matches; GA4 'matches regex' patterns as whole-value matches. Every 'Matches' example had to match and every 'Does not match' example had to fail. The same checks were then run in the browser's engine with the tester's settings, with the same results. The patterns use example brands, towns and domains; edit them before use.

    Download all 44 as a spreadsheet: search-console-regex-library-2026-11-18.csv. Free to reuse with a link.

    Related