Skip to content
Sign in

Regex filters in Search Console: practical patterns

Search Console's custom regex filter turns the Performance report into a much sharper tool. A dozen patterns cover most needs: separate brand from non-brand, find questions and comparisons, isolate long-tail queries, and group pages by section.

DeskSEO editorial team · · 6 min read

A prospector sifts river gravel through a metal pan in a clear sunny stream

The Performance report in Search Console lets you filter queries and pages with a custom regular expression (choose the filter, then "Custom (regex)", and "Matches regex" or "Doesn't match regex"). That one option turns a long, flat list of queries into something you can actually analyse: brand versus non-brand traffic, question queries, comparison searches, long-tail queries, and pages grouped by section. You do not need to be fluent in regex. A handful of patterns covers most needs.

The syntax you need

Search Console uses RE2 syntax. The essentials:

SymbolMeaningExample
|Orboots|shoes matches either word
^Start of the value^how matches queries starting with "how"
$End of the valuenear me$ matches queries ending with "near me"
.Any single characterb.g matches bag, big and bug
?Previous character optionalcolou?r matches colour and color
* / +Zero or more / one or more\s+ one or more spaces
\bWord boundary\bvs\b matches "vs" as a word, not inside "canvas"
( )Group(best|top) boots
\Escape a special character\. matches a literal dot
(?i)Case-insensitive(?i)stride

RE2 does not support lookaheads ((?!…)). When you want to exclude something, use the "Doesn't match regex" option with a positive pattern instead.

Brand versus non-brand

Separating brand from non-brand queries is the most useful filter of all. Brand queries depend on how well known you are; non-brand queries show how well your content competes. For a hypothetical shop called Stride & Co:

(?i)stride|strideco|stride and co|stride & co|stirde

Include common misspellings and spacing variants you find in the query list. Apply with "Matches regex" for brand traffic and "Doesn't match regex" for non-brand. Then compare trends: non-brand growth is the clearest sign that SEO work is paying off.

Reading the brand split

Once the two views exist, a few patterns are worth knowing. Brand clicks rising while non-brand clicks stay flat usually means marketing, PR or word of mouth is working, while search content is not adding new audiences. Non-brand rising while brand stays flat means content is reaching new people who do not yet know the name. A drop in brand impressions is rarely an SEO problem; it reflects fewer people looking for you, which is a business signal worth passing on. And if brand clicks fall while brand impressions hold, something is taking clicks on your own name: a competitor's ads, a review site, a marketplace listing or a new results-page feature.

Question queries

^(who|what|when|where|why|how|which|can|does|do|is|are|should|will)\b

Shows queries phrased as questions, a good source of FAQ content and of topics where featured snippets and AI answers are likely. Add the equivalent question words for other languages if your site is multilingual. See featured snippets and People Also Ask.

A librarian pulls one specific book from a long shelf of matching blue spines

Comparison and alternative queries

\b(vs|versus|or|compared|comparison|alternative|alternatives|better than)\b

Shows queries where people are choosing between options. These are high-intent and often worth a dedicated comparison page. The or term catches "x or y" queries but also some noise; remove it if the results are too broad.

Commercial modifiers

\b(best|top|cheap|cheapest|price|prices|cost|buy|review|reviews|deal|discount)\b

Useful for finding commercial-investigation queries landing on informational pages, a common sign of intent mismatch; see search intent.

Long-tail queries by word count

^(\S+\s+){5,}\S+$

Matches queries with six or more words. Long queries are increasingly common and often more specific in intent. Comparing their trend with shorter queries shows how searcher behaviour on your site is changing. To see one- and two-word queries only, use ^\S+(\s+\S+)?$.

Local intent

(?i)\bnear me\b|\bnearby\b|\b(leeds|bradford|york|harrogate)\b

Replace the town names with your own service area. Shows how much traffic comes from location-qualified searches.

Page filters: sections and templates

The page filter works on full URLs. Group pages by section:

/guides/          blog or guide section
/products?/       product pages, singular or plural
/category/|/collections/   category pages on common platforms
\?                any URL with parameters
/(de|fr|es)/      language folders

Each line above is a separate pattern; use one at a time, or combine with |. Section filters let you compare how different templates perform, check a migration section by section, and spot parameter URLs receiving impressions (often a sign of crawl or canonical issues).

Finding cannibalisation candidates

Filter by one important query with an exact match pattern, such as ^waterproof hiking boots$, then switch to the Pages tab. If several of your URLs receive impressions for the same query and positions are unstable, see keyword cannibalization.

Common mistakes

  • Forgetting that patterns match anywhere. boots also matches "bootstrap" and "reboots". Use \bboots\b for whole words.
  • Unescaped dots in URLs. example.com/guides works by accident because the dot matches any character, but \. is the correct form when it matters.
  • Too-short brand patterns. A brand called "Arc" matched with arc catches "search", "archive" and "arcade". Anchor it with word boundaries and check the matches.
  • Using lookaheads. RE2 rejects them; use the "Doesn't match regex" option.
  • Comparing filtered numbers with unfiltered totals. Query filters exclude anonymised queries, so a filtered total is not a share of the full chart total.

A worked example

A hypothetical outdoor shop wants to know why organic clicks were flat over a year when its content team published sixty new guides. Applying the brand filter shows brand clicks fell slightly, in line with a quieter year for the business, while non-brand clicks grew by a healthy margin. The question filter shows most of that growth came from "how" and "which" queries landing on the new guides. The commercial-modifier filter shows "best" queries landing on guides rather than category pages, a sign that some guides compete with categories for buying-intent searches. Three patterns, one afternoon, and a flat headline number turned into three clear findings: content is working, brand demand is softening, and guides and categories need clearer roles.

Practical tips

  • Test patterns on a small date range first, check the matched queries look right, then widen the range.
  • Save useful filters as bookmarks. Filter settings are stored in the report URL, so a bookmarked URL reopens the same view.
  • Remember the anonymised queries. Rare queries are hidden from the query table for privacy, so regex filters on queries only see the visible part; totals in the chart for a query filter will be smaller than the full site total. See Search Console data limits.
  • Mind the length limit. Very long patterns, such as huge brand lists, may exceed the maximum length allowed; keep them focused.
  • Export for heavier analysis. For complex grouping, export the data or use the API, and apply the same patterns in a spreadsheet or script.

The same patterns elsewhere

RE2-style patterns also work, with small differences, in Looker Studio, in Google Analytics filters, in spreadsheet functions such as REGEXMATCH, and in most scripting languages. Building your brand, question and section patterns once and reusing them across reports keeps definitions consistent: "non-brand" means the same thing in the monthly client report as it does in the Search Console view you checked this morning. Keep the patterns in a shared document with a note of when each was last updated, especially the brand list, which grows as you notice new misspellings and product names.

A starter set

  1. Brand and non-brand.
  2. Questions.
  3. Comparisons.
  4. Commercial modifiers.
  5. Long-tail (six words or more).
  6. Each main section of the site as a page filter.

Review them monthly alongside the overall totals. If you also track positions day by day with a tool such as DeskSEO, once Search Console is connected, the same grouping helps you see which kinds of queries are moving.

Questions

Which regex syntax does Search Console use?

RE2, the syntax used across many Google products. It supports common features such as alternation, character classes and anchors, but not lookaheads or lookbehinds. Use the "Doesn't match regex" option instead of negative lookaheads.

Is the regex filter case-sensitive?

Regex matching can be case-sensitive. Queries are usually stored in lowercase, but page URLs may contain capitals. Adding (?i) at the start of a pattern makes it case-insensitive.

Does a regex need to match the whole query?

No. By default the pattern matches anywhere within the value. Use ^ and $ to anchor it to the start or end.

Can I combine several regex filters?

You can add one query filter and one page filter at the same time, plus filters for country, device and search appearance. For several conditions on the same dimension, combine them into one pattern with alternation.

Keep reading