Book a call

How to Group Search Queries with Search Console Regex

A few carefully tested Search Console filters can turn a long list of queries into a repeatable starting point for an SEO decision.

A useful query family starts with a decision

Imagine a commercial cleaning firm with time to improve one service page. Its team wants to know whether the page answers the pricing and selection questions that potential customers bring to Google. Grouping visible queries into families gives the team a way to choose what to investigate and repeat the analysis later.

The firm and examples in this guide are fictional. Your customers may use different words, and Search Console shows only part of the picture. Check the page and search results before making changes.

Set up a reliable report

Open the Performance report for Search results in the right Search Console property. Choose a search type and a fixed date window with complete data. Add a Query or Page filter, choose the custom regular expression option and select whether the expression should match or exclude results. Apply a country or device filter if the decision concerns a particular market or audience.

Record the property, search type, country, device, dates, expression and whether it matches or excludes. A colleague can use that record to repeat the work. Start with a broad view, then apply one filter at a time so you can see what changes.

Google's advanced filtering guidance explains that Search Console uses RE2 expressions for query and page filters. Matching is partial and case-insensitive by default. A pattern can match text within a longer query or URL. Use ^ to anchor the start and $ to anchor the end when the boundaries matter. The vertical bar means “or”, parentheses group alternatives, and a backslash escapes punctuation with a special meaning. The RE2 syntax reference lists supported expressions and identifies features such as lookarounds and backreferences that RE2 doesn't support.

Build and test three reusable filters

Test each expression against a match and a nonmatch before relying on its results. Paste the pattern into the appropriate custom regex filter without the surrounding code fence. Test it in your own property and adjust the wording, language and URL structure to suit your site.

Find questions that start with a question word

For the cleaning firm, this query filter gathers some explicit questions that could reveal information gaps.

^(how|what|when|where|why|can|does) 

Keep the space after the closing parenthesis. It matches how much does office cleaning cost and misses office cleaning cost, which doesn't start with one of those words. It also misses questions phrased in other ways, including is office cleaning expensive. Add terms that help with the decision, then check what they bring in.

Group service variants

Use this query filter to collect two phrases the firm uses for its commercial service.

office cleaning|commercial cleaning

It matches office cleaning prices and commercial cleaning perth, while house cleaning doesn't match. Partial matching can also bring in office cleaning jobs, a false positive if the team is investigating buyers. A narrower pattern such as (office cleaning|commercial cleaning).*(price|cost|quote) matches office cleaning cost and misses office cleaning jobs. It will also miss cost of office cleaning because the pricing word comes first. Inspect the results and decide which omissions are acceptable before using the family to prioritise work.

Isolate a service page path

Use a Page filter to examine a fictional service URL and its slash or query-string variants.

/services/office-cleaning(/|$|\?)

It matches https://example.com/services/office-cleaning, the same URL with a trailing slash, and https://example.com/services/office-cleaning?ref=search. It misses https://example.com/services/office-cleaning-supplies. The escaped question mark represents a literal ?. Check which URLs Search Console actually reports for your site, including canonical URLs and trailing slashes, before adapting the path. Since matching is partial, add a suitable hostname or start anchor if other paths could contain the same text.

Turn the filtered results into an investigation

Compare the chosen period with an equally long previous period using the same property, search type and other filters. Check clicks, impressions and click-through rate together. A change in one measure can have several explanations, and a small number of impressions can make CTR volatile. Average position combines impressions and can hide differences between queries and pages. Google's explanation of data grouping and aggregation helps when a total changes as you change the view.

For the fictional firm, a question filter might reveal several visible pricing queries and an established service page receiving impressions. Open representative queries and pages in the report, read the page and inspect relevant search results. Does the page address the question clearly? Is there a useful next step for someone considering the service? The answer may justify adding a pricing explanation, checking an existing page or collecting more evidence first.

Write down the pattern, comparison windows, observed result and a hypothesis. Assign an owner and a date to review the change. If multiple pages appear for the same query, use the exact-query cannibalisation diagnostic before deciding they compete.

Interpret the limits of filtered data

Filtered query families aren't a complete account of demand. Google explains that anonymised queries and row limits affect what appears in the report. Query filters exclude anonymised queries, and table rows can be truncated. Page filters can change aggregation and totals too. Keep those limits and the sample size in mind when drawing conclusions.

Google's separate generative AI performance report offers clicks, impressions and CTR, with page, country, date and device dimensions. Its availability depends on sufficient impressions, and its documented dimensions don't include queries. A long or conversational query in the ordinary report doesn't establish AI Mode use, AI Overview exposure or a citation.

Google describes query fan-out as related queries generated by a model to retrieve additional results. Given the available report dimensions, ordinary query filters don't expose those internal queries. A pattern also cannot establish that an AI feature caused a traffic change.

Choose the next useful step

If a family shows a decline, investigate competing explanations with the Google traffic drop diagnostic. If the team needs analysis at a larger scale and has an export, the BigQuery analysis guide takes that work further.

For the cleaning firm, the decision is whether the evidence warrants improving the service page's pricing information. Revisit the tested filter as data accumulates.