Intro
Group city-modified searches in GSC so you can report on explicit place-name demand without relying on page-level local assumptions.
Use this regex to isolate city-based searches in GSC when your reporting needs to focus on explicit city modifiers in the query.
The Regex
How This Regex Works (Explained Simply)
()
Parentheses group terms together so GSC treats them as one unit. That is what lets one regex cover several query variants in a single filter.
|
The pipe means OR. GSC will match any term on either side of the pipe, which is useful for variants, modifiers, or alternative phrases.
\b
Backslash-b marks a word boundary. It helps stop short terms from matching inside longer words in GSC queries.
GSC regex is case-insensitive by default, so capital letters do not need separate variants. GSC also uses partial matching by default, so the regex can match part of a longer query unless you anchor it with ^ or $.
What This Regex Does
- Matches grouped city names as standalone terms.
- Separates city-led local demand from generic local or near me traffic.
- Works as a template you can replace with your own target cities.
What it does not match
- edinburgh plumbers - Edinburgh only matches in the variation.
- plumber near me - This is local intent, but no grouped city name appears.
Edge Cases
- This recipe is only as good as the city list you maintain, so keep it aligned with your target markets.
- Large grouped city lists can become hard to manage, so split them when they grow.
Example Matches Table
| Query | Match | Why |
|---|---|---|
| seo agency london | Match | Contains london, which is in the grouped city names. |
| manchester plumbers | Match | Contains manchester as a city modifier. |
| edinburgh plumbers | No | Edinburgh only matches in the variation. |
| plumber near me | No | This is local intent, but no grouped city name appears. |
How to Use This in Google Search Console
- Open Performance and go to Search results.
- Click Add filter and choose Query.
- Select Custom (regex).
- Paste the regex and click Apply.
When to Use This
- Track performance across named target cities.
- Benchmark city-page visibility against broader local demand.
- Identify which cities drive the strongest local clicks and impressions.
Pro Tips
- This is a template recipe, so swap in the cities that matter to your business.
- Keep the word boundaries so shorter place names do not create accidental matches.
- Use one city group per region if you need cleaner reporting splits.
- Compare city demand against your landing-page footprint to spot coverage gaps.
Variations
Add another target city
Extends the grouped city list with one more location.
Related Regex Recipes
Regex for Region-Based Queries
Use this regex to isolate region-based searches in GSC when users search by broader area rather than a specific town or city.
Regex for Location + Service Queries
Use this regex to isolate location-plus-service searches in GSC when users combine a place and a service type in the same query.
CTA
Regex is only the first step. The real bottleneck is turning manual filters into a repeatable workflow your team actually uses. Spicy Metrics helps you move from ad hoc filtering to operational SEO workflows.
Move beyond manual regex work