Search Console regex filters: syntax, examples and gotchas
How the Custom (regex) filter in Search Console's Performance report works: RE2 syntax, case rules, and tested patterns for questions, brands and folders.
Search Console’s Performance report lets you filter queries and pages with a regular expression: choose Add filter, pick Query or Page, select Custom (regex), then Matches regex or Doesn’t match regex. It uses Google’s RE2 syntax, matches anywhere in the text unless you anchor it with ^ or $, and is not case-sensitive by default; put (?-i) at the start for a case-sensitive match. Regex is how you isolate question queries, branded searches, long-tail queries or a group of folders in one filter.
This is a guide to the Search Console web interface. QueryWatch does not have regex filters, and we say more about what it does instead at the end.
How to add a regex filter
- Open a property and go to Performance → Search results.
- Click + Add filter in the filters row at the top of the report.
- Choose Query or Page.
- In the match-type menu, choose Custom (regex).
- Type the expression. Keep the default, Matches regex, to include what it matches, or switch to Doesn’t match regex to exclude it.
- Click Apply. The chart, the totals and every tab of the table now reflect the filter.
Google documents the filter in its advanced filtering help page. The same expressions work in the Search Analytics API through the includingRegex and excludingRegex operators.
What RE2 supports, and what it does not
RE2 covers everything you need for this job: alternation with |, anchors ^ and $, character classes such as [a-z] and \d, the word boundary \b, whitespace \s and non-whitespace \S, and repetition with ?, *, + and {n,}. A dot matches any character, so a literal dot is \. and a literal question mark is \?.
What it leaves out is lookahead, lookbehind and backreferences. If a pattern you found online contains (?! or (?<=, it will not work here. You rarely need it. Instead of a negative lookahead, write a pattern for the thing you want gone and choose Doesn’t match regex.
Patterns worth saving
Replace the example brand, northwind, and the example domain with your own. Each pattern was checked against Google’s RE2 library with case-insensitive matching, as Search Console applies it.
| Goal | Filter | Regex |
|---|---|---|
| Question queries | Query, matches | ^(who|what|when|where|why|how|which|can|does|is|are|should)\b |
| Branded queries | Query, matches | northwind|north wind|nortwind |
| Non-branded queries | Query, doesn’t match | northwind|north wind|nortwind |
| Long tail, five words or more | Query, matches | ^\S+(\s+\S+){4,}$ |
| Short head, one or two words | Query, matches | ^\S+(\s+\S+)?$ |
| Comparison and price intent | Query, matches | \b(vs|versus|alternatives?|compare|reviews?|price|pricing|cost)\b |
| Queries with a year in them | Query, matches | \b20[0-9]{2}\b |
| One folder | Page, matches | /blog/ |
| Several folders | Page, matches | /(blog|guides|help)/ |
| The home page and nothing else | Page, matches | ^https://www\.example\.com/$ |
| URLs with parameters | Page, matches | \? |
| PDF files | Page, matches | \.pdf$ |
| A case-sensitive path | Page, matches | (?-i)/Products/ |
The question pattern is anchored with ^ and closed with \b on purpose. Without them, “how” also matches “show”, “however” and “knowhow”. The long-tail pattern counts runs of non-space characters, so “how to fix crawled currently not indexed” is seven words and qualifies.
The comparison pattern is a useful companion to a striking-distance list: queries at positions 8 to 20 with buying intent in them are often the ones worth an afternoon.
The gotchas
Page values are full URLs. The Page dimension stores https://www.example.com/blog/post, not /blog/post, so ^/blog/ matches nothing. Either drop the anchor or include the protocol and host.
Unanchored patterns match anywhere. That is helpful for folders and harmful for short words, which is why the question pattern above is anchored.
Spaces are characters. how | why matches “how “ and “ why” with the spaces included, which is rarely what you meant. Write how|why.
Case is ignored by default. Some guides tell you to add (?i) to make a pattern case-insensitive; in Search Console that is already the behaviour, and (?-i) is the switch that turns case sensitivity on.
Totals shrink when you filter by query. Google’s help says anonymised queries are included in chart totals unless a query filter is applied, and filtering by query or URL can also be affected by data truncation. Expect branded plus non-branded to come to less than the unfiltered total. Row limits and anonymised queries explains why.
Exports stay capped. An export from the report is truncated to 1,000 rows, filtered or not. The upside is that a filter gives you a different 1,000 rows, so a large site can export its long tail folder by folder.
Regex or the branded queries filter?
Search Console now has a built-in branded queries filter, which Google’s help on report dimensions describes as separating queries that include your brand name, your domain, or a brand-specific product or service. It saves you maintaining a list of misspellings. It also has limits: it is not available for sub-properties such as https://example.com/blog/ or for sites with a low number of impressions, and Google notes that some queries might be classified incorrectly.
Use the built-in filter where you have it and it looks right. Keep the regex for sub-properties, smaller sites, and any case where you need to control exactly which terms count as brand, such as a product name that is also an ordinary word.
Letting Search Console write the regex
Google is testing an AI-powered configuration for the Performance report, opened from the filter icon in the report header, which turns a plain-language request into filters and comparisons, including regex query filters. It is experimental, visible to a small percentage of users, limited to 20 requests a day, and Google warns that it may produce filters that do not match your request. If you have it, read the regex it writes before you trust the numbers under it.
Where QueryWatch fits
QueryWatch does not offer regex filtering; this post is about the web interface, and on a phone that means the mobile web version of Search Console. What QueryWatch does instead is cover some of the jobs people write regex for. The striking-distance view lists queries at positions 8 to 20, ranked by opportunity, on the free tier. The watchlist tracks specific queries, pages or query-page pairs, five on the free tier and unlimited on Pro. And the current view, including the top 100 queries or pages, exports as CSV.
When you need a pattern, open Search Console. When you want to know what moved this morning, the app is quicker. QueryWatch is an independent app and is not affiliated with Google.
Questions
Can I use regex filters in the Search Console API?
Yes. The Search Analytics API accepts includingRegex and excludingRegex as filter operators, using the same RE2 syntax, and its documentation lists a maximum length of 4,096 characters for a filter expression.
Does Search Console regex support negative lookahead?
No. RE2 does not support lookahead, lookbehind or backreferences. To exclude something, write a pattern that matches it and choose Doesn't match regex instead.
Why don't my branded and non-branded clicks add up to the total?
Applying any query filter removes anonymised queries from the totals, and those can be a large share of a site's clicks. Branded plus non-branded will therefore usually come to less than the unfiltered total, and that is expected.
Can I filter Search Console by regex on my phone?
Yes, in Search Console's own web interface opened in a phone browser, which has the same filter. QueryWatch does not offer regex filtering, so on a phone the browser is the way to do it.
Keep reading
Get QueryWatch
Free on iPhone and Android for every property you have, with no site limit. Open Demo Mode first if you want to look around before you connect a Google account.
iPhone needs iOS 26 or later; Android needs Android 12 or later. Free to download, with an optional Pro subscription. An independent app, not affiliated with Google.