Intro

Identify postcode-style searches in GSC so you can report on highly precise local intent with stronger geographic specificity.

Use this regex to isolate postcode-style searches in GSC when users search with specific location identifiers rather than place names.

The Regex

\b[a-zA-Z]{1,2}\d[a-zA-Z\d]?\s?\d[a-zA-Z]{2}\b

How This Regex Works (Explained Simply)

[]

Square brackets match one character from a set. They are useful for small spelling or formatting variations without writing every full word.

?

The question mark usually makes the previous character or group optional. That is handy when a query modifier appears inconsistently.

{n,m}

Curly braces control how many times something can repeat. Use them when you need tighter matching than * or + gives you.

\d

Backslash-d matches a digit. It is useful for years, model numbers, and numeric modifiers in GSC queries.

\s

Backslash-s matches a whitespace character. It is useful when spacing can vary between query formats.

\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 many common UK-style postcode formats.
  • Surfaces highly precise local intent that often maps closely to service eligibility.
  • Separates postcode searches from city and region-level local demand.

What it does not match

  • seo consultant zip code - Zip code only matches in the variation.
  • seo consultant manchester - This is city intent, not postcode intent.

Edge Cases

  • This is format-based rather than place-name-based, so test it against your actual geography and audience.
  • Alphanumeric patterns can be noisy if your query set includes product codes or IDs.

Example Matches Table

Query Match Why
plumber sw1a 1aa Match Contains a postcode-like format that matches the pattern.
seo consultant m1 1ae Match Uses a postcode-style location identifier.
seo consultant zip code No Zip code only matches in the variation.
seo consultant manchester No This is city intent, not postcode intent.

How to Use This in Google Search Console

  1. Open Performance and go to Search results.
  2. Click Add filter and choose Query.
  3. Select Custom (regex).
  4. Paste the regex and click Apply.

When to Use This

  • Measure very granular local demand.
  • Audit service-area precision in local query data.
  • Find whether postcode-led searches land on the right local pages.

Pro Tips

  • This is a postcode-format template, so adapt it if your market uses different location codes.
  • Code-like patterns can create false positives, so validate them against real query exports.
  • Postcode demand often signals very strong local intent, so landing-page fit matters.
  • Keep postcode queries separate from city and region views for cleaner reporting.

Variations

Include explicit zip-code phrasing

\b([a-zA-Z]{1,2}\d[a-zA-Z\d]?\s?\d[a-zA-Z]{2}|zip code)\b

Adds another location-code term used in some datasets and markets.

Related Regex Recipes

CTA

Building query segments manually in GSC works for one-off checks, but it breaks down across multiple sites and stakeholders. Spicy Metrics keeps those segments organised and easy to monitor.

Scale segmentation in Spicy Metrics