GSC Regex Pattern Builder
Build and test regex patterns for Google Search Console query and URL filters
1Build Pattern
Building Blocks
2Test Queries
Using Regex in Google Search Console
Google Search Console supports regex (RE2 syntax) for filtering queries and pages in the Performance report. To use regex, click "New" filter, select "Query" or "Page", then choose "Custom (regex)" from the filter type dropdown. GSC uses RE2 syntax, which supports most common regex features but excludes lookaheads and backrefernces.
Common SEO Regex Patterns
Filter by Questions
^(what|how|why|when|where|who) Match queries starting with question words. Great for identifying FAQ content opportunities.
Brand Queries
your-brandSimple text match to filter branded vs non-branded traffic. Use with "Does not match" to exclude brand queries.
Long-tail Keywords
^\S+ \S+ \S+ \S+Match queries with 4+ words. Long-tail keywords often have higher conversion rates and lower competition.
Commercial Intent
(buy|price|cost|best|review|deal)Identify queries with commercial or transactional intent for conversion optimization.
URL Subfolders
/blog/|/guides/|/tutorials/Filter pages by URL path segments. Useful for analyzing performance of specific content sections.
Year-Specific
20(24|25|26)Match queries or URLs containing specific years. Helps identify time-sensitive content.
RE2 vs PCRE
Supported in RE2
- . * + ? - Basic quantifiers
- ^ $ - Anchors (start/end)
- ( ) - Grouping
- | - Alternation (OR)
- [ ] - Character classes
- \d \w \s - Shorthand classes
- { } - Repetition quantifiers
Not Supported in RE2
- (?=) (?!) - Lookahead
- (?<=) (?<!) - Lookbehind
- \1 \2 - Backreferences
- (?>) - Atomic groups
- (?(cond)) - Conditionals
- \b - Word boundaries (limited)
Best Practices
- ✓ Keep patterns simple — complex regex can be hard to maintain and debug
- ✓ Always test with real queries from your GSC data before applying filters
- ✓ Use the case-insensitive flag (i) — most search queries are lowercase
- ✓ Combine regex with date range filters for more precise analysis
- ✓ Remember GSC uses RE2 syntax — no lookaheads or backreferences
- ✓ Use ^ and $ anchors to avoid unintended partial matches
Frequently Asked Questions
Does GSC support full regex?
GSC uses RE2 syntax, which is a restricted subset of regex. It supports most common features (character classes, quantifiers, alternation, anchors) but excludes lookaheads, lookbehinds, and backreferences.
How can I filter non-branded queries?
In GSC, add a Custom (regex) filter for Query with "Does not match" and enter your brand name variations: (mybrand|my brand|my-brand). This will show only non-branded organic traffic.
Can I use multiple regex filters at once?
Yes, GSC allows combining multiple filters. You can have one regex filter on Query and another on Page simultaneously. Alternatively, use the | (OR) operator to combine patterns in a single filter.