Reading time: 12 minutes
The Google Search Console regex filter lives in the Performance report: under Add filter, choose Queries and then Custom (regex). With RE2 syntax, it finds long, question-style queries that look like AI prompts. Here are the regex patterns we tested, the filter’s limits and how to use the results.
In short
- The filter sits under Queries > Custom (regex). It uses RE2 syntax, matches any part of the query and, by default, isn’t case-sensitive.
- In RE2,
\wand\bonly recognize unaccented letters. So, in any language with accents, use the space (\s) and\Sto separate words. - A long, question-style query is a sign of conversational search, but it doesn’t prove the query came from AI. After all, no query filter separates AI Mode from regular search.
- With a query filter, anonymized queries also drop out of the chart total. Therefore, only compare numbers measured with the same filter.
How do you use regex in the Search Console query filter?
The Google Search Console regex filter sits in the Performance report for Search results. First, click Add filter and choose Queries. Then switch the type to Custom (regex) and paste the expression. Finally, keep Matches regex or choose Doesn’t match regex, which shows all the other queries, and click Apply.
According to Search Console Help, the regex filter follows three rules:
- Syntax: Search Console uses RE2 syntax.
- Partial match: the regex matches any part of the query, unless it starts with
^(start) or ends with$(end). - Case: the filter isn’t case-sensitive, unless the expression starts with
(?-i).
The option names in this guide follow Google’s help pages, so your screen may show slightly different labels. Doesn’t match regex works as the negation, because RE2 doesn’t support negative lookahead.

What RE2 syntax does Search Console accept?
Search Console accepts RE2 syntax, from Google’s regular expression library. It covers the basics, such as alternatives, optional parts and counted repetitions. However, RE2 doesn’t support lookahead or backreferences, and \w and \b only recognize unaccented letters.
| Feature | In RE2 |
|---|---|
Start and end: ^how, worth$ | Supported |
Optional part: log ?in | Supported |
Counted repetition: (\S+\s+){7} | Supported, up to 1,000 |
Space and non-space: \s, \S | Supported |
Case-sensitive match: (?-i) | Supported |
Letter and word boundary: \w, \b | Unaccented letters only |
Lookahead and lookbehind: (?=...) | Not supported |
Backreference: \1 | Not supported |
The vertical bar separates alternatives, so how|what matches one word or the other. The question mark makes the previous character optional, while braces count repetitions.
This letter limit matters most in languages with accents, such as Portuguese, Spanish or French. For RE2, \w equals [0-9A-Za-z_], so “é”, “ç” and “ã” don’t count as letters. As a result, \bvocê\b doesn’t find the Portuguese word “você” (you), because RE2 sees no word boundary after the “ê”. The same goes for words like café or résumé. That’s why the question regex patterns in this guide use the space (\s) to mark the end of a word.
Which regex filters questions (how, what, why, which)?
The regex below catches queries that start with a question word, such as “how”, “what”, “which” and “why”. Only whole words count, though: the space at the end (\s) keeps out “however” and “whatsapp”. Then apply the filter with Matches regex and sort the table by impressions.
^(how|what|which|where|when|who|why|is|are|can|could|should|does|do)\s
The ^ anchors this Search Console regex to the start of the query. Meanwhile, words like is, can, should and does catch yes-or-no questions, such as “is it worth” or “can I”.
Google itself suggests this use. On the Search Central blog, for example, it says a regex filter with question words can show whether your content needs to answer questions.
On the other hand, to find a question word anywhere in the query, change the start and the end of the regex. Keep only the “wh” words here, because is, can and do also show up in the middle of queries that aren’t questions, such as “crm that is free”:
(^|\s)(how|what|which|where|when|who|why)(\s|$)
This version also catches questions such as “crm how it works”. But it adds noise, because “how” also shows up in queries like “work how you want”. In our test of the Portuguese versions, the anywhere regex found more questions. However, it brought in five off-target queries, while the first regex brought in none.
How do you filter queries with many words?
To find long queries, count the spaces. The regex below asks for seven blocks of word plus space, followed by one more word. In other words, it finds queries with eight words or more. To change the minimum, replace the 7 with the number of words minus one. Since matching is partial, the regex doesn’t need ^ or $.
(\S+\s+){7}\S
\S+ is any run of characters without a space, so it accepts accents, numbers and hyphens. By contrast, \w+ breaks at accented letters. In our test with Portuguese queries, the same Search Console regex with \w instead of \S found only 13 of the 31 long queries. The original found all 31. In general, start with eight words and adjust: lower the number if too little comes back, or raise it if too much does.
Finally, to combine question and length in one filter, add the count to the regex, after the question word. The version below asks for at least five words after the question word, so six or more in total:
^(how|what|which|where|when|who|why|is|are|can|could|should|does|do)(\s+\S+){5}
How do you separate branded and non-branded queries?
There are two ways: the branded and non-branded queries filter in Search Console itself, and a regex with the brand’s variations. The filter splits the two groups on its own, but it doesn’t show up for every site. The regex, on the other hand, works in any property, with Matches regex for the brand and Doesn’t match regex for the rest.
According to Google’s announcement, this Google Search Console filter doesn’t use regex but an internal, AI-assisted system. The branded queries filter recognizes the brand name, misspellings and brand-related products. However, it only appears in top-level properties, not in URL path or subdomain properties, and it needs enough query volume. Google also warns that some queries may end up in the wrong group.
To build the regex, list the name, its variations and common misspellings, as in Google’s example for a company called Willow Tree:
willow tree|wilow tree|willowtree|willowtee
To shorten the list, use the question mark. That way, the version below covers Google’s four spellings plus four more, such as “wilowtree”:
wil?low ?tr?ee
But in our test, neither one caught “willow tre”, a typo outside the list. In other words, a Search Console regex only finds what you anticipate.
Finally, the API lets you combine the question regex and the brand regex. According to the Search Console API documentation, one group accepts several required filters, such as an includingRegex for questions and an excludingRegex for the brand.
What does Search Console hide when you filter?
Search Console hides anonymized queries and rows beyond its limits. Anonymized queries never show up in the table, which displays at most 1,000 rows. Still, without a filter, they count toward the chart total. When you apply a regex filter to queries, however, Google Search Console also removes anonymized queries from the total, according to the help page on data discrepancies.
In a 2022 post, Google defined an anonymized query as one issued by no more than a few dozen users over two to three months. In the post’s example, a site has 550 clicks, but the listed queries add up to 450. So the filter with “fiction” shows 175 clicks, and the filter without “fiction” shows 275. In other words, the 100 anonymized clicks fall outside both.
This probably weighs more on long questions, but Google doesn’t say how many end up anonymized. After all, a unique question, asked by a single person, tends to be anonymized. That’s why a Search Console regex mostly shows the questions that repeat, not every long question that reaches Google.
There’s also a cut by volume. On a few very large sites, the daily row limit removes data from the report. Even so, Google says it believes the rest forms a representative sample. For the most complete list, the help page on dimensions points to bulk data export. Overall, only compare numbers with the same filter, such as one month against the previous one.
Is a long query in Search Console an AI prompt?
Not necessarily. A long, question-style query is a sign of conversational search, but it doesn’t prove the query came from AI. That’s because the Performance report adds Google’s AI Mode to regular search, under the Web search type, with no filter to separate them. So the same question could have come from either one.
Still, the signal makes sense. In fact, in the U.S., the average AI Mode search is three times as long as a traditional search query, according to Google. In addition, each follow-up question in AI Mode counts in the report as a new query. The counting rules are in the guide to AI data in Search Console.
To read the results, follow four steps:
- Sort by impressions: this way, the questions that show up most come first.
- Open the Pages tab: with the regex filter on, it shows which pages get these questions.
- Compare periods: with the regex filter applied, compare one month with the previous one to see if long questions are growing.
- Check the CTR: compare the CTR of these questions with the organic CTR of the rest of the site.
How do you turn these queries into prompts to track your brand in AI?
Use the filtered questions as the base of your prompt list. The idea is to rewrite each query the way someone would ask an assistant. Then run the same list every month in ChatGPT, Gemini and AI Mode. That way, each month compares with the previous one.
- Export: with the regex filter applied in Google Search Console, the export button downloads the chart and the table.
- Clean up: next, merge variations of the same question and drop the ones outside your business.
- Rewrite: for example, “how much clinic scheduling software” becomes “How much does online scheduling software cost for a small clinic in Brazil?”.
- Classify: sort them into category, problem, comparison and brand, the four groups of the measurement protocol.
- Freeze: finally, keep the same list for a quarter.
The rest of the protocol is in the guide on how to measure brand mentions and citations in AI. It covers the number of prompts and the margin of error, for example. What makes AI cite a page, on the other hand, is in the SEO and AI guide.
On Bing, according to Microsoft, the AI Performance report in Bing Webmaster Tools shows a sample of grounding queries. These are the phrases the AI used to retrieve the cited content, not necessarily the users’ questions. Still, they help you check whether your list covers the right topics.
What we found when testing the Search Console regex patterns
We tested each regex with 99 sample queries outside Google Search Console, but with its rules: RE2 syntax, partial matching and no case sensitivity. Since the original version of this guide is for Brazil, the queries and the question regex patterns were in Portuguese.
We built the list with questions, short queries, brand queries and accented words. Also, across all the regex patterns, our Python test and Go’s regexp package, which follows RE2 syntax, gave the same results. This is the Portuguese question regex we tested:
^(como|qual|quais|quant[oa]s?|onde|quando|quem|por ?qu[eê]|o que|pra que|para que|vale a pena|é possível|existe|posso|devo|você)\s
- Questions at the start, with a space: the regex found 43 of the 53 questions, with no off-target queries.
- Questions with
\binstead of the space: it found only 39, because it missed the four that started with “você” (you), “por quê” or “porquê” (why). - Brand: Google’s list found 10 of the 12 brand queries, while the short version found 11.
- Without the space at the end: the question regex pulled in, for example, “comodato” (free loan), “devolução” (refund) and “existencialismo” (existentialism).
- Lookahead: the regex threw a syntax error in Go, as the RE2 documentation predicts.
Frequently asked questions
In some accounts, yes. The Performance report’s AI-powered configuration tool takes a text request and suggests filters, including a query regex filter, which you confirm before applying. However, the feature is experimental, only visible to a small share of users and limited to 20 requests per day per user. So check the regex before you use the results, since the tool can get it wrong.
It works with some changes. GA4’s help also points to RE2 syntax, but by default a GA4 regex must match the whole value and is case-sensitive. In Search Console, by contrast, matching is partial and ignores case. To filter visits from AI assistants, see the guide to AI traffic in GA4.
Yes. Just choose Pages instead of Queries in the same filter menu, and then Custom (regex). Also, the rules stay the same: RE2 syntax, partial matching and no case sensitivity. Google’s example, shoes/.*/green, matches the pages for green shoes of any brand or size.
Main sources
- Search Console Help, advanced filtering and comparison in the Performance report (2026).
- RE2, regular expression syntax reference (2023).
- Search Console Help, report dimensions, anonymized queries and branded queries (2026).
- Google Search Central, filtering and limits of performance data (2022).
- Google Search Central, quick tips on regex filters (2021).
- Google Search Central, branded queries filter in Search Console (2025).
- Google, how AI Mode is changing search in the U.S. (2026).


