Home SEO Tools GSC Regex Builder

GSC Regex Builder

The part of GSC where you type something that looks like a password and hope it works. RE2 regex for URL and query filtering — 22 ready-made templates, live validation, and explanations in actual English. No regex trauma (or googling) required.

RE2 syntax note — GSC does not support all regex features
  • No negative lookaheads (?!...) — you cannot "exclude" a pattern in one regex
  • No backreferences \1 \2
  • Partial match by default — GSC applies as "contains". Use ^ / $ to anchor.
  • URLs are case-sensitive. Queries are case-insensitive.
  • Max ~1000 characters.
Template library

Paste a URL and click path segments to select them. 1 click = match literal value (teal). 2 clicks = match by character count (purple). 3 clicks = deselect. Mix both types to build hybrid patterns.

Your regex
Choose a template or enter values…
No regex yet
Explanation will appear here.
Live tester
Where to use in GSC
Performance report → Add filter → Page → Custom (regex) → paste
Performance → Filters → Page → Custom (regex)

What is Google Search Console Regex?

GSC lets you filter your Performance report by Page (URL) and Query using a Custom (regex) option. Instead of a single keyword or exact URL, regex lets you match patterns across hundreds of URLs or queries at once — brand terms, directory paths, intent clusters, pagination, query length, and more.

The catch: GSC uses RE2, Google's own regex engine. RE2 is faster than PCRE but forbids several features developers expect — including negative lookaheads, backreferences, and atomic groups. Patterns that work perfectly in regex101.com or Python can silently fail in GSC. This tool generates patterns guaranteed to work in RE2.

Page (URL) Filters

Filter to specific directories, URL structures, parameterised pages, or pagination. URL filters are case-sensitive/Blog/ will not match /blog/.

Query Filters

Segment queries by intent (informational, transactional, commercial), brand mentions, question words, query length, or keyword clusters. Query filters are case-insensitive.

Partial Match by Default

GSC treats every regex as a partial (contains) match. A pattern of /blog/ matches any URL containing that string. For Page filters, GSC matches against the full URL (e.g. https://example.com/blog/post), so ^ anchors to the protocol — use ://[^/]+/blog/ to anchor to the start of the path. For Query filters, ^ anchors to the start of the query string normally.

Character Limit: ~1,000

GSC's documented regex limit is approximately 1,000 characters. This tool warns at 800 characters to leave a safe margin — a detail most other tools miss entirely.

How to Use the Builder

Build your pattern here, paste it directly into GSC. Here's the exact workflow.

01

Choose your mode

The URL Picker lets you paste any URL and click its parsed segments to build a pattern visually. The Manual Builder gives full control over match mode and values. The Template Library has 22 pre-built patterns for the most common GSC use cases — one click to apply, with live-update parameter inputs for your own values.

02

Build and validate your pattern

The output panel shows your regex in real time with a RE2 status badge: green (valid RE2), amber (works but has risks), or red (will fail in GSC). Hard errors — like negative lookaheads — are flagged immediately with specific, actionable messages. A plain-English explanation tells you exactly what the pattern matches.

03

Test against real URLs or queries

Paste your actual URLs or queries into the Live Tester. Results update on every keystroke — green dots for matches, red for non-matches, with an X/Y summary. Structural verification before you ever touch GSC. Note: the tester uses case-insensitive matching; URL filters in GSC are case-sensitive, so verify case manually if needed.

04

Paste into Google Search Console

Copy your pattern with one click. In GSC: Performance → Add filter → Page (or Query) → Custom (regex) → paste. Note that only one Page filter and one Query filter can be active at a time. The "Where to use in GSC" guide at the bottom of the output panel updates dynamically depending on what you're filtering.

Google Search Console → Performance → Search results → Filters
Query
Page ✓
Country
Device
Custom (regex)
Contains
Equals
://[^/]+/blog/[^/]+/[^/]+/

Ready-Made GSC Regex Patterns

Every pattern below is taken directly from the template library above. All are RE2-validated and safe to paste into GSC. Use the builder to customise them with your own values.

URL / Page Filters
GoalRegex patternNotes
All pages in a directory://[^/]+/blog/Matches all pages in the /blog/ directory. Using ://[^/]+ skips the protocol and domain — works for both http and https without hardcoding your domain. The /blog/ then anchors to the first path segment.
URL contains a keywordshoesPartial match — catches /shoes/, /womens-shoes/, /sale-shoes/. No anchors needed.
Top-level pages only://[^/]+/[^/?]+/?$Matches pages with exactly one path segment — e.g. example.com/about, example.com/blog. ://[^/]+ matches the domain, [^/?]+ matches one path segment (no slashes or query strings), /?$ allows an optional trailing slash.
Second-level pages only://[^/]+/[^/]+/[^/?]+/?$Matches pages exactly two path segments deep — e.g. example.com/blog/post-title. Useful for auditing a specific content tier.
Any URL with query parameters\?The backslash escapes the literal ?. Catches any URL with a query string.
Has a specific parameter[?&]utm_source=[?&] handles first-param (?) and subsequent-param (&) positions. Swap utm_source for your param name.
Clean URLs (no query string)^[^?]+$RE2 has no true negation, so [^?]+ — only non-? characters — is the correct workaround.
Paginated URLs (page 2+)(/page/[2-9]|/page/[0-9]{2,}|\?p=[2-9]|\?p=[0-9]{2,}|\?page=[2-9]|\?page=[0-9]{2,})Covers /page/, ?p=, and ?page= formats. Single and multi-digit page numbers handled separately.
Faceted navigation params[?&](color|size|brand|filter)=List your facet param names separated by |. Add as many as needed.
Specific file types\.(pdf|xlsx|docx)$Ends-with anchor + escaped dot. Swap in your extensions.
AMP pages/amp(/|$)(/|$) matches /amp/ and /amp at path end. Prevents false matches on words like /amphibian/.
Language/locale prefix://[^/]+/(en|fr|de|it|pl|es)/Matches hreflang-style URLs where the locale is the first path segment — e.g. example.com/en/page. Add or remove codes to match your i18n structure.
Query Filters
GoalRegex patternNotes
Question queries^(what|how|why|when|where|who|which|is|are|can|does|do)\bStarts-with anchor + word boundary \b prevents "what" matching "whatnot". Query filters are case-insensitive in GSC.
Commercial / buy intent\b(buy|purchase|price|cheap|discount|deal|coupon|order|shop|sale|cost)\bBoth word boundaries ensure whole-word matching — "deals" will not match "deal".
Comparison intent\b(vs|versus|compare|comparison|review|reviews|alternative|alternatives)\bCatches mid-funnel commercial research queries at the comparison stage.
How-to / guide queries\b(how to|guide|tutorial|step by step|step-by-step|walkthrough)\bMulti-word phrases like "how to" work correctly inside \b boundaries in RE2.
Best / top queries\b(best|top [0-9]+|[0-9]+ best|top rated|top-rated|recommended)\bCovers "top 10", "10 best", "top-rated". Number patterns use [0-9]+ for any digit count.
Local intent(near me|nearby|in my area)Add city names like |\bin london\b|\bin new york\b to extend beyond proximity terms.
Brand mentions(yourbrand|yourbrand inc)List brand variants including common misspellings. Contains mode — matches brand anywhere in the query.
Long-tail queries (4+ words)\w.+ \w.+ \w.+ \w.+\w.+ matches a word starting with an ASCII character followed by any characters — works for multilingual queries where words may contain accented characters after the first letter.
Head terms (1–2 words)^\w+( \w+)?$Matches queries of exactly 1 or 2 words, fully anchored. Same ASCII limitation applies — accented characters in queries will not be matched by \w.
Keyword whole-word match\bseo\bWhole-word only — "seo" will not match "seotool". Replace with your keyword.
💡
Customise any pattern in the builder above

Every pattern in this table can be built and customised using the Template Library tab above. Paste your own values and the regex updates instantly.

GSC Regex Cheat Sheet

GSC uses RE2 — Google's own regex engine. These are the metacharacters that actually work. Anything not on this list is either unsupported or unreliable in GSC.

|
OR operator
Matches either the expression on its left or its right.
shoes|boots|trainers
^
Starts with
Anchors the match to the start of the string. For Page filters, GSC URLs start with https:// — so ^ anchors to the full URL, not just the path.
^https://example\.com/blog/ → pages in /blog/
$
Ends with
Anchors the match to the end of the string.
/contact$ → must end with /contact
.*
Any characters
Matches zero or more of any character.
review → URL contains "review" (simpler than .*review.*)
( )
Grouping
Groups expressions together. Essential for OR logic across whole terms.
^(buy|purchase|order)
[ ]
Character class
Matches any single character within the brackets.
[0-9] → any digit
[^ ]
Negated class
Matches any character NOT in the brackets. Used for clean URL workarounds.
[^/]+ → any non-slash chars
\b
Word boundary
Matches the position between a word char and a non-word char. Prevents partial matches.
\bseo\b → "seo" not "seotool"
{N,}
Quantifier (min)
Matches N or more repetitions of the preceding element.
[^/]{5,} → slug ≥ 5 chars
\w
Word character
Matches [a-zA-Z0-9_] — ASCII only. Does not match hyphens, accented characters (é, ą, ó), or other non-ASCII letters. Avoid for multilingual query filtering.
\w.+ \w.+ → 2+ words, multilingual-safe
\.
Escaped dot
Matches a literal dot. Unescaped, dot matches any character.
\.(pdf|docx)$ → file extensions
\?
Escaped question mark
Matches a literal ?. Unescaped, ? is a quantifier (zero or one).
\? → URL has query string
🚫
These do NOT work in GSC (RE2 forbids them)
  • Negative lookaheads (?!...) — RE2 forbids them entirely. Use GSC's "does not match regex" filter instead.
  • Negative lookbehinds (?<!...) — same restriction.
  • Backreferences \1, \2 — RE2 does not track capture groups for reuse.
  • Atomic groups (?>...) — not supported in RE2.
  • Positive lookbehinds (?<=...) — limited, inconsistent RE2 support. Test carefully before using.

5 Ways to Use GSC Regex in Your SEO Workflow

These are the most impactful use cases — each with the exact pattern you'd apply in GSC.

Use case 01

Audit a relaunched section's query performance

You've just relaunched your /services/ section with new page structure. Apply a Page filter to isolate those URLs, then switch the dimension to Queries to see exactly what search terms are driving traffic to the new pages — without the noise of your whole site.

Page filter
://[^/]+/services/
Matches all pages under /services/. GSC Page filters match against full URLs (https://...) — using ://[^/]+ skips the protocol and domain without hardcoding them.
Use case 02

Separate branded from non-branded traffic

Brand vs. non-brand is one of the most critical segmentations in GSC. Apply a Query filter with your brand name, then use a second filter set to "does not match" the same pattern. Compare CTR, average position, and impressions across both segments to understand your true organic footprint.

Brand filter — Query → matches
(yourbrand|yourbrand inc|yourbrand.com)
List all brand name variants. Note the numbers, then switch to "does not match" with the same pattern for the non-brand view. These are two separate analysis sessions — GSC does not support both simultaneously.
Use case 03

Find question-intent queries for content gap analysis

Filter all queries beginning with question words to see where informational demand is arriving. Cross-reference with low average position (ranking 8–20) to identify pages that need FAQ sections or dedicated how-to content to move up.

Query filter
^(what|how|why|when|where|who|which|is|are|can|does|do)\b
The word boundary \b prevents "what" matching "whatnot". Sort by impressions to surface highest-volume question queries.
Use case 04

Identify keyword cannibalisation candidates

Paste multiple similar URL slugs into the URL Picker and select them all as teal (literal) segments. The builder produces a single regex matching all of them. Apply it in GSC to see if multiple pages are ranking for the same queries — a clear signal of cannibalisation to resolve.

Multi-URL Page filter (OR mode)
(/seo-tools/|/seo-tool/|/free-seo-tools/)
The builder combines multiple URL selections into one OR pattern automatically. Switch to AND mode for separate filter entries.
Use case 05

Isolate paginated URLs eating crawl budget

Pagination pages are a common crawl budget drain. Filter all paginated URLs using the Paginated URLs template to see how much of your click and impression share is going to page 2+ — and whether those pages should be noindexed or consolidated.

Page filter
(/page/[2-9]|/page/[0-9]{2,}|\?p=[2-9]|\?p=[0-9]{2,})
Covers /page/, ?p=, and ?page= formats. Single and multi-digit page numbers handled separately to avoid false matches on page 1.

What GSC Regex Cannot Do

Understanding RE2's constraints prevents hours of debugging. These are the most common places where SEOs hit a wall — and the right workaround for each.

🔗
Cannot AND two conditions on the same dimension

GSC allows only one filter per dimension — one Page filter and one Query filter can be active at a time. You cannot stack two Page filters, and RE2 can't express AND in a single pattern either. If you need "URL must match A AND B", it is simply not achievable within one GSC session. What IS possible: combining filters from different dimensions simultaneously — a Page filter AND a Query filter both apply with AND logic.

🚫
Cannot negate in-pattern

RE2 has no real negation operator. To exclude patterns, use GSC's "does not match regex" filter option alongside a standard positive pattern — two filter entries, not one regex.

🎯
Cannot enforce exact segment position

The URL Picker approximates position-based matching via consecutive/non-consecutive patterns but cannot guarantee "only segment 3 must be X" — a genuine RE2 constraint, not a tool limitation.

🔤
URL filters are case-sensitive

GSC enforces case sensitivity on Page filters. The live tester always uses case-insensitive matching — so a match in the tester against a capitalised URL could be a false positive in real GSC.

#
Fragment (#hash) segments unavailable

Fragments are not transmitted to the server and do not appear in GSC data. Fragment segments in the URL Picker are intentionally non-clickable — filtering by hash is not possible in GSC by design.

💾
No saved history

The tool has no import, export, or session memory — a refresh resets everything. This is intentional: no data ever leaves your browser. Copy your patterns before closing the tab.

Frequently Asked Questions

Does regex work in Google Search Console?
Yes. GSC supports regex in the Custom (regex) filter for both Query and Page dimensions in the Performance report. The engine is RE2 — Google's own regex implementation — which is more restrictive than standard PCRE. Negative lookaheads, backreferences, and atomic groups are not supported and will cause your filter to fail silently or be rejected.
What is the character limit for GSC regex?
Google Search Console has a documented regex character limit of approximately 1,000 characters. This builder warns at 800 characters to leave a safe margin. If you're hitting the limit, consider grouping — example.com/(aa|bb) is shorter than example.com/aa|example.com/bb and produces identical matches.
Is regex case-sensitive in Google Search Console?
It depends on the dimension you're filtering. Page (URL) filters are case-sensitive — a pattern of /Blog/ will NOT match /blog/. Query filters are case-insensitive — a pattern of buy will match "Buy", "BUY", and "buy". This is one of the most misunderstood behaviours in GSC regex.
What's the difference between RE2 and PCRE?
RE2 is Google's own regex engine, designed to guarantee linear-time matching at scale. PCRE (Perl Compatible Regular Expressions) is used by most programming languages, tools like regex101.com, Python, and VS Code. The key practical difference: RE2 forbids negative lookaheads (?!...), negative lookbehinds (?<!...), backreferences, and atomic groups. Patterns that work in PCRE-based tools may silently fail in GSC. This builder only produces RE2-safe output.
Can I use negative lookahead in Google Search Console?
No. Negative lookaheads (?!...) are forbidden in RE2 and GSC will reject or silently mishandle filters that include them. The correct workaround is to use GSC's built-in "does not match regex" filter option alongside a standard positive pattern. You apply two filter entries rather than trying to negate within a single regex.
How do I filter brand vs. non-brand queries in GSC?
Create a brand filter using a Query → matches regex pattern like (yourbrand|yourbrand inc). Then duplicate the filter and switch it to "does not match" with the same pattern to see non-brand traffic. You cannot do this in a single RE2 regex — two separate GSC filter entries are required. The builder's AND output mode helps by splitting patterns into numbered filter outputs.
Does GSC regex use partial match or full match by default?
Partial match (contains) by default. A pattern of blog will match any URL or query containing "blog" anywhere — /blog/, /my-blog-post/, /categories/blogging/ all match. Use ^ to anchor the start, $ to anchor the end, or wrap both — ^pattern$ — for an exact match. The builder's match mode selector handles all of this automatically.
How do I use AND logic between GSC regex filters?
GSC allows one filter per dimension — one Page filter and one Query filter active at a time. You cannot have two Page filters or two Query filters simultaneously. RE2 also cannot express AND within a single pattern. This means "URL must match A AND B" is not achievable if both conditions target the same dimension. However, you CAN combine filters across different dimensions: a Page filter of ^/blog/ plus a Query filter of \bhow to\b are applied simultaneously and both must match — showing only "how to" queries that landed on blog pages. For same-dimension AND conditions, the only option is to encode both conditions into a single regex where structurally possible (for example, combining path and query parameter conditions into one pattern).

Sources