# Search Console regex filters

Where the regex filter is, the rules it follows, eight patterns worth saving, and how to have your assistant write the pattern for you.

## Where the regex filter is

In Search Console, open **Performance**, click **+ Add filter** (or **New**), choose **Query** or **Page**, then pick **Custom (regex)**. You can choose **Matches regex** or **Doesn't match regex**.

- Search Console uses [RE2 syntax](https://github.com/google/re2/wiki/Syntax). Lookaheads and backreferences are not supported.

- Matching is not case-sensitive by default. Start the expression with `(?-i)` to make it case-sensitive.

- A pattern matches anywhere in the query or URL unless you anchor it with `^` (start) or `$` (end).

- A pattern with a syntax error returns no rows rather than an error, so an empty table can mean a typo.

## Patterns worth saving

| Use | Filter | Pattern | What it shows |
| --- | --- | --- | --- |
| Question queries | Query, matches | `^(who\|what\|when\|where\|why\|how\|which\|can\|does\|is\|are\|should)\b` | Queries phrased as questions: good material for FAQ sections and headings. |
| Brand vs non-brand | Query, doesn't match | `mowteng\|mow teng\|milowda` | Everything except your brand and its misspellings, so growth from new searchers is visible. Replace with your own names. |
| Long-tail queries | Query, matches | `^(\S+\s+){4,}\S+$` | Queries of five words or more. |
| Comparison intent | Query, matches | `\b(vs\|versus\|alternative\|alternatives\|compare\|comparison)\b` | People choosing between products. |
| Buying intent | Query, matches | `\b(best\|top\|review\|reviews\|pricing\|price\|cost\|cheap)\b` | Queries close to a decision. |
| One folder | Page, matches | `^https://example\.com/blog/` | Only pages under /blog/. Escape the dots. |
| A few pages at once | Page, matches | `/(pricing\|features\|signup)/?$` | Several exact pages without adding filters one by one. |
| URLs with parameters | Page, matches | `\?` | Pages reached with a query string, which often point to duplicate URLs. |

Combine a regex filter with a date comparison to see which group moved: for example, non-brand question queries, last 28 days against the 28 days before.

## Let your assistant write and run the pattern

Regular expressions are easy to get almost right. With mowteng connected, you describe the group in words, and your assistant writes the pattern and runs it through `gsc_search_analytics`, which accepts `includingRegex` and `excludingRegex` filters on queries and pages. You see the rows, and the pattern it used, in the same answer.

> **Ask your assistant:** For example.com, show question queries from the last 28 days that don't mention my brand, sorted by impressions. Show the regex you used.

> **Ask your assistant:** Compare clicks for pages under /blog/ between the last 28 days and the 28 days before, and list the five pages that dropped most.

The same filters work in the [date comparison](https://mowteng.app/analyses/compare-date-ranges) and help narrow [striking distance](https://mowteng.app/analyses/striking-distance-keywords) or [cannibalization](https://mowteng.app/analyses/keyword-cannibalization) checks to one part of the site.

## Common mistakes

- **Unescaped dots.** In `example.com` the dot matches any character. Write `example\.com`.

- **Missing anchors.** `/blog` also matches `/old-blog-posts`. Use `^https://example\.com/blog/`.

- **Too many alternatives.** A long list of words is hard to check. Split it into two filters or two questions.

- **Reading anonymized queries as missing.** Search Console hides rare queries for privacy, so a query filter never adds up to the site total.

## Related

- [Search performance prompts](https://mowteng.app/prompts/performance): Find out what changed in clicks and why.

- [Compare date ranges](https://mowteng.app/analyses/compare-date-ranges): Compare periods by page, query, country or device.

- [Striking distance keywords](https://mowteng.app/analyses/striking-distance-keywords): Queries at positions 11 to 20.

- [A weekly SEO check](https://mowteng.app/guides/weekly-seo-check): One question that covers every engine.

Source: https://mowteng.app/guides/search-console-regex
