siteline Start free trial Log in

Search Console regex examples

See your data

These are the Search Console regex filters we actually reuse, grouped by the question they answer. Each one is written for RE2, the syntax Search Console uses, so none of them rely on lookaheads or backreferences that Google will not run. Swap in your own words, test the pattern in the free GSC regex builder, then paste it into the Performance report.

Where to paste a regex in Search Console

  1. Open Performance → Search results.
  2. Click + Add filter and choose Query or Page.
  3. Choose Custom (regex).
  4. Pick Matches regex or Doesn't match regex in the second dropdown.
  5. Paste the pattern and click Apply.

Four rules from Google's filtering documentation explain most surprises:

Patterns are commonly reported to be capped at 4,096 characters, which is plenty unless you paste a whole keyword list.

Brand and non-brand

Replace acme with your brand, its misspellings and its product names.

  1. acme|akme|acmee with Matches regex: Brand queries, including common misspellings.
  2. acme|akme|acmee with Doesn't match regex: Non-brand queries (same pattern, other dropdown).
  3. acme ?(login|sign in|app) with Matches regex: Navigational brand queries you can usually ignore for SEO.
  4. ^acme$ with Matches regex: The bare brand query only.

Why split them: brand clicks rise and fall with marketing, not with rankings. Non-brand is the number that tells you whether SEO is working. Keep the brand pattern in one place and reuse it every month, or the split drifts as you add product names.

Questions and intent

  1. ^(who|what|when|where|why|how|which|can|does|do|is|are|should)\s: Queries that start with a question word.
  2. \?$: Queries typed with a question mark.
  3. \b(vs|versus|compared to|comparison)\b: Comparison queries.
  4. \b(alternative|alternatives|competitor|competitors)\b: "Alternatives to X" queries.
  5. \b(best|top|review|reviews|rated)\b: Commercial research queries.
  6. \b(price|pricing|cost|cheap|free|discount|coupon)\b: Price-sensitive queries.
  7. \b(how to|tutorial|guide|example|examples|template)\b: How-to and learning queries.
  8. \bnear me\b: Local-intent queries.

Question queries are the fastest source of FAQ headings that match how people search. Comparison and alternatives queries are usually where a small site can beat a big one, because the big site will not write "us vs them".

Long-tail and query length

  1. ^(\S+\s+){4,}\S+$: Queries of five words or more.
  2. ^\S+$: One-word queries.
  3. ^(\S+\s+){1,2}\S+$: Two- and three-word queries.
  4. 20(2[4-9]): Queries that mention a year from 2024 to 2029.

Pattern 13 is the long-tail filter. Sort the result by impressions and look for queries where you rank between 4 and 20. Those are the cheapest wins on most young sites, and our striking-distance view does the same job from a CSV export.

Pages, folders and URL patterns

Page filters match the full URL, including https:// and the host, so anchor carefully.

  1. /blog/ with Matches regex: Every page in the blog folder.
  2. /(blog|guides|resources)/ with Matches regex: Several content folders at once.
  3. /(blog|guides)/ with Doesn't match regex: Everything except content (product, home, landing pages).
  4. ^https://www\.example\.com/[^/]+/?$ with Matches regex: Top-level pages only, one folder deep.
  5. \? with Matches regex: URLs with any query string (often duplicates worth canonicalising).
  6. [?&](utm_|gclid|fbclid) with Matches regex: Tracking parameters that leaked into Google's index.
  7. \.pdf$ with Matches regex: PDF files ranking in search.
  8. /product/[0-9]+ with Matches regex: Product pages with numeric ids.
  9. (?-i)/[A-Z] with Matches regex: URLs containing capital letters, a common duplicate source.

Pattern 22 is worth running once a quarter. If campaign URLs are getting impressions, your canonical tags are not doing their job. How campaign tags should behave: UTM tracking without cookies.

Patterns that fail in Search Console

These work in many online testers but not in Search Console, because RE2 does not support them:

Looks like Example Use instead
Negative lookahead ^(?!.*acme).*$ Pattern 2: the brand list with Doesn't match regex
Lookbehind (?<=/blog/).* /blog/.+
Backreference (\w+) \1 Write the repeated word out
Possessive or atomic group a++, (?>a) Plain a+

If a filter returns no rows at all, check for one of these first, then check whether you anchored a page pattern without the https:// part.

Combining filters

Search Console lets you stack filters. Two common pairs:

Stacked filters are an AND. For an OR, put both alternatives into one pattern with |.

When a regex filter is not enough

Regex filters work on whatever Search Console still holds, which is 16 months, and on what the UI shows you, which is 1,000 rows per table. If you run the same brand split or folder comparison every month, you will hit both limits:

SiteLine keeps a Search Console archive (about 16 months backfilled on connect, up to 25k rows per day per report, kept while you subscribe) so the same filters still work on last year's data. It also exposes that archive to agents over read-only MCP. Start a 7-day trial, no card · pricing from $4.99/mo.

FAQ

What regex syntax does Google Search Console use?

RE2, Google's regular expression library. It supports alternation, character classes, anchors, \s, \S, \d, \b and repetition counts like {4,}. It does not support lookarounds, backreferences or possessive quantifiers.

Is Search Console regex case-sensitive?

No. Matching is case-insensitive by default. Put (?-i) at the start of the pattern to make it case-sensitive.

How do I exclude queries with regex in Search Console?

Write the pattern for what you want to exclude, then pick Doesn't match regex in the second dropdown. Do not try to build the exclusion into the pattern with (?!...); RE2 rejects it.

How do I filter for long-tail keywords in Search Console?

Use ^(\S+\s+){4,}\S+$ as a Query filter with Matches regex. It keeps queries of five or more words. Change the 4 to 3 for four-word queries and up.

Why does my regex return no data?

Usually one of three things: an unsupported construct such as a lookahead, a page pattern anchored with ^ but missing https:// and the host, or a date range with no matching rows. Test the pattern against real rows in the regex builder first.

Can I use regex in the Search Console API?

Yes. The Search Analytics API accepts includingRegex and excludingRegex as dimension filter operators, with the same RE2 rules.