Free tool, no signup required

Free GSC Regex Generator

Describe the filter you want in plain English. Get a Google Search Console regex that RE2 will actually accept, explained token by token, with a live tester.

Put multi-word terms in double quotes. Everything runs in your browser, so nothing you type is sent anywhere.

Question queriesDimension: Query
Filter: Matches regex
(?i)^(who|what|when|where|why|which|how|is|are|was|were|am|do|does|did|can|could|should|will|would|has|have|had)\b

Matches queries that open with a question word, which is the closest proxy Search Console gives you for informational intent.

What each part does

(?i)Makes everything after it case insensitive. Search Console regex is case sensitive without this, so a pattern for "seo" would miss "SEO".
^Anchors the match to the very start of the string.
(who|what|when|where|why|which|how|...)Any one of the 23 listed question words.
\bA word boundary, so "how" matches "how to rank" but not "howard johnson".

Test it, one string per line

how to run an seo audit✓ In report
what is a canonical tag✓ In report
does google index pdfs✓ In report
seo audit tool✗ Filtered out
howard johnson hotels✗ Filtered out

Tested with your browser's regex engine. It agrees with RE2 on every pattern this tool produces, though RE2 would reject a lookahead that your browser accepts.

Before you paste this in

  • Leave the (?i) prefix in place unless you specifically want case sensitivity. Search Console reports capitalisation exactly as it was searched.
  • Plenty of question intent arrives without a question word, as in "seo audit cost". Pair this with a word count filter to catch the rest.
  • Search Console matches partially, so a pattern with no ^ or $ matches anywhere inside the string. You do not need .* on either end.

What this GSC regex generator does

It converts a sentence like queries containing "seo audit" but not "jobs" into a regular expression you can paste into the Custom (regex) filter in Google Search Console. It also tells you which dimension to apply it to and whether to use Matches regex or Doesn't match regex.

The important part is the flavour. Search Console runs RE2, not the PCRE syntax that most regex tutorials teach, and the two constructs people reach for first are both missing from it.

  • No lookahead for AND. A pattern like (?=.*seo)(?=.*audit) is rejected outright. This generator writes AND as every ordering spelled out, such as seo.*audit|audit.*seo.
  • No negative lookahead for NOT. There is no way to say "not this" inside an RE2 pattern. Exclusions come from flipping the filter to Doesn't match regex, which the tool tells you to do.
  • Case sensitivity is on by default. Every pattern here starts with (?i) unless you ask for case sensitivity, because a filter for seo otherwise misses every impression recorded against SEO.
  • Partial matching. A pattern with no anchors matches anywhere in the string, so wrapping it in .* at both ends adds nothing.

Nothing is sent to a server. The parser runs in your browser, which means the same sentence always produces the same pattern and there is no daily limit on how many you generate.

What you can describe

The parser recognises these shapes. Put any multi-word term in double quotes so it survives the splitting.

  • Contains, any of: queries containing "seo audit" or "site audit"
  • Contains, all of: queries containing "seo" and "audit" and "free"
  • Position: starts with, ends with, or is exactly a given term
  • Exclusions: queries that do not contain "jobs", or containing "seo" but not "jobs"
  • Intent groups: question queries, comparison queries, commercial intent, near me intent
  • Brand splits: branded queries, or non-brand queries excluding your brand terms
  • Length: queries with 4 words or more, or with 40 characters or more
  • URL shapes: a named subfolder, paginated URLs, URLs with parameters, UTM tagged URLs

How to use a regex filter in Google Search Console

The filter lives in the Performance report and takes about twenty seconds to set up. The only step people miss is the second dropdown, which is where exclusions actually happen.

  1. 01

    Open the Performance report

    In Search Console, go to Performance, then Search results. Set the date range first, because changing it later resets nothing but is easy to forget.

  2. 02

    Add a Query or Page filter

    Click the plus icon next to the filter chips at the top of the report, then choose Query or Page depending on which dimension your pattern targets.

  3. 03

    Switch the match type to Custom (regex)

    The dropdown defaults to Contains. Open it and pick Custom (regex). Search Console only offers regex on the Query and Page dimensions.

  4. 04

    Choose Matches regex or Doesn't match regex

    This second dropdown is how you express NOT. RE2 has no negative lookahead, so an exclusion is always the filter inverting a positive pattern.

  5. 05

    Paste the pattern and apply

    Paste the generated regex, then click Apply. An invalid pattern is rejected on the spot, so a filter that applies cleanly is at least syntactically valid.

  6. 06

    Confirm the row count moved

    A filter that returns exactly the same totals usually means the pattern matched everything. A filter returning zero rows usually means capitalisation, so check the (?i) prefix survived the paste.

The check that catches most mistakes

Note the row count before you apply the filter and again after. A count that did not move means the pattern matched everything, and a count of zero almost always means capitalisation rather than a broken pattern.

Google Search Console regex library: 20 patterns

Every pattern below is the exact output this generator returns for the statement in the second column. Copy the regex, set the dimension and match type as listed, and it will apply cleanly.

GoalSay thisRegexDimensionMatch type
Question queries onlyqueries that are questions(?i)^(who|what|when|where|why|which|how|is|are|was|were|am|do|does|did|can|could|should|will|would|has|have|had)\bQueryMatches regex
Long tail queriesqueries with 4 words or more^\S+(?:\s+\S+){3,}$QueryMatches regex
Head terms onlyqueries with 2 words or fewer^\S+(?:\s+\S+){0,1}$QueryMatches regex
Branded queriesbranded queries containing "crawlraven" or "crawl raven"(?i)(crawlraven|crawl raven)QueryMatches regex
Non-brand queriesnon-brand queries, excluding "crawlraven" and "crawl raven"(?i)(crawlraven|crawl raven)QueryDoesn't match regex
Comparison queriesqueries comparing two things(?i)(\bvs\b|\bvs\.|\bversus\b|compared to|comparison|difference between|alternatives? to)QueryMatches regex
Commercial intentqueries with commercial buying intent(?i)(buy|price|pricing|cost|cheap|affordable|discount|coupon|deal|for sale|order|quote)QueryMatches regex
Local intentqueries with near me intent(?i)(near me|nearby|near my location|in my area|closest|close to me)QueryMatches regex
Any one of several topicsqueries containing "seo audit" or "site audit" or "website audit"(?i)(seo audit|site audit|website audit)QueryMatches regex
All terms present, any orderqueries containing "seo" and "audit" and "free"(?i)(seo.*audit.*free|seo.*free.*audit|audit.*seo.*free|audit.*free.*seo|free.*seo.*audit|free.*audit.*seo)QueryMatches regex
Prefix matchqueries that start with "how to"(?i)^(how to)QueryMatches regex
Suffix matchqueries that end with "checklist"(?i)(checklist)$QueryMatches regex
One exact queryqueries that are exactly "seo audit tool"(?i)^(seo audit tool)$QueryMatches regex
Everything except a topicqueries that do not contain "jobs" or "salary"(?i)(jobs|salary)QueryDoesn't match regex
One blog subfolderurls in the "blog" subfolder(?i)/(blog)/PageMatches regex
Paginated URLspaginated urls(?i)(/page/\d+|[?&]page=\d+|/p/\d+)PageMatches regex
URLs with parametersurls with query parameters\?PageMatches regex
UTM tagged URLsurls with utm parameters(?i)[?&]utm_PageMatches regex
Topic minus a subtopicqueries containing "seo" but not "jobs"(?i)(seo)QueryMatches regex
Very long queriesqueries with 40 characters or more^.{40,}$QueryMatches regex

The two rows marked Doesn't match regex are the ones worth reading twice. Their patterns describe what you want removed, and the match type is what removes it.

RE2 syntax cheat sheet for Search Console

These are the tokens that come up in Search Console work. Anything not listed here is either unsupported by RE2 or rarely useful against query and URL data.

TokenWhat it meansExample
(?i)Ignore capitalisation from here on(?i)seo matches SEO and Seo
|Or, between alternatives(audit|analysis)
( )Group, so a quantifier or the pipe applies to all of it(seo|ppc) audit
^Start of the string^how to
$End of the stringchecklist$
.Any single characterseo.audit
.*Any run of characters, including noneseo.*audit
\.A literal full stop, because a bare dot means any characterexample\.com
\?A literal question mark, because a bare one means optional\?utm_
\bA word boundary\bseo\b skips seoul
\dAny digit/page/\d+
\sAny whitespace characterseo\saudit
\SAny non-whitespace character^\S+$ is a one word query
+One or more of the previous token\d+
?The previous token is optionalalternatives?
{2,4}Between two and four of the previous token(\s+\S+){3,}
[a-z]Any one character from the set[0-9]{4}
(?: )A group that does not capture, which RE2 runs slightly cheaper(?:\s+\S+)+

Not available in RE2

Lookahead (?=), negative lookahead (?!), lookbehind (?<=), backreferences \1, and atomic groups. A pattern using any of them is rejected by Search Console as invalid, not silently ignored.

Six mistakes that break a Search Console regex filter

Each of these produces a filter that applies without an error and returns the wrong rows, which is worse than a pattern that fails loudly.

1. Using a lookahead to require two words

(?=.*seo)(?=.*audit) is the standard PCRE answer and RE2 rejects it. Write every ordering instead, joined with pipes.

  • Two terms need two branches: (?i)(seo.*audit|audit.*seo)
  • Three terms need six branches, which the generator writes for you
  • Four or more gets unreadable at 24 branches, so filter on three and finish in a spreadsheet

2. Forgetting that matching is case sensitive

A pattern for iphone misses every impression recorded against iPhone. The fix is a (?i) at the very start of the pattern, not in the middle, since it only applies to what follows it.

3. Leaving a dot or a question mark unescaped

In a pattern, . means any character and ? makes the previous token optional. A filter for example.com also matches exampleXcom, and a filter meant to find query strings does nothing at all unless it is written \?.

4. Wrapping everything in .* out of habit

Search Console matches partially, so .*seo audit.* and seo audit return identical rows. The wrapper only makes the pattern harder to read and harder to debug later.

5. Anchoring a Page filter without the protocol

The Page dimension holds the full URL, so ^/blog/ matches nothing at all. Use ^https://example\.com/blog/ to anchor properly, or drop the caret and match /blog/ anywhere in the URL.

6. Trying to express NOT inside the pattern

There is no way to do it in RE2. Write the pattern for what you want gone, then set the match dropdown to Doesn't match regex. This is also how a non-brand report is built.

What to do once the filter is applied

A regex filter is a way of asking a question, so it is worth knowing which questions pay. These four come up on almost every audit.

  1. Non-brand trend. Filter out brand terms, then compare non-brand clicks month over month. This is the number that actually reflects SEO work.
  2. Question queries with no matching page. Filter to question queries, sort by impressions, and look for rows where the landing page is a category or the home page.
  3. Long tail sitting on page two. Filter to four words or more, then sort by position and look between 11 and 20. These are the cheapest wins on most sites.
  4. Folder level performance. Filter the Page dimension to one subfolder and compare clicks per URL against another. Totals mislead when folder sizes differ.

Each of those is a manual export and a pivot table. CrawlRaven does the join for you: it crawls the site, pulls Search Console and GA4 in as built-in integrations, and ranks the fixes by the traffic actually attached to them.

More on that in content SEO insights, or browse the other free SEO tools.

Frequently Asked Questions

Does Google Search Console support regex filters?

Yes. Search Console added regex filtering in April 2021, and it is available on the Query and Page dimensions of the Performance report under the Custom (regex) match type. Each dimension accepts one regex filter, and each filter can be set to either Matches regex or Doesn't match regex.

What regex flavour does Google Search Console use?

Search Console uses RE2, Google's own regular expression library. RE2 guarantees linear time matching, and it buys that guarantee by dropping the features that can backtrack: lookaheads, lookbehinds and backreferences are all unsupported. The same RE2 syntax applies in Google Analytics 4 and Looker Studio, so a pattern that works in one usually works in the others.

Why does my lookahead regex fail in Search Console?

Because RE2 has no lookahead at all. Patterns like (?=.*seo)(?=.*audit) for AND, or ^(?!.*jobs) for NOT, are rejected as invalid. Write AND as an explicit alternation of every ordering, such as seo.*audit|audit.*seo, and write NOT by setting the filter to Doesn't match regex against a positive pattern.

Is Search Console regex case sensitive?

Yes, by default. A pattern for seo will miss the impressions recorded against SEO, which is a common reason a filter appears to return far less data than expected. Put (?i) at the very start of the pattern to make everything after it case insensitive.

How do I write a regex that matches several words in any order?

Spell out every ordering and join them with pipes. Two terms give two branches, as in seo.*audit|audit.*seo. Three terms give six. Beyond three the pattern gets unwieldy, so filter on the three most important terms in Search Console and finish narrowing the list in a spreadsheet after export.

How do I exclude keywords with a Search Console regex?

Write the pattern for what you want to remove, then set the match dropdown to Doesn't match regex. To drop several terms at once, list them as alternatives: (?i)(jobs|salary|career|login). Because the filter does the inverting, the pattern itself stays positive.

How do I separate branded from non-brand queries in Search Console?

Build one pattern covering every brand variation, including misspellings, the spaced and unspaced forms, and the bare domain. Apply it as Matches regex for the branded view and Doesn't match regex for the non-brand view. Non-brand clicks are the number worth trending, since branded demand moves with marketing rather than with SEO.

Does a Search Console regex have to match the whole query?

No. Search Console uses partial matching, so a pattern with no ^ or $ matches anywhere inside the string. Wrapping a pattern in .* on both ends changes nothing and only makes it slower to read. Add ^ or $ when you specifically want a prefix, a suffix or an exact match.

Is there a length limit on Search Console regex?

Yes, a pattern can be up to 4,096 characters. That is generous for most work, but a brand list with hundreds of misspellings or an all-orderings pattern for five terms can reach it. Split the work across two reports if you get close.

Can I use regex on both Query and Page at the same time?

Yes. The two dimensions take separate filters, so you can combine a Page regex for one subfolder with a Query regex for question queries and see only the informational demand landing on that section. What you cannot do is stack two regex filters on the same dimension.

Why does my regex filter return no data at all?

Three causes account for almost all of it. Capitalisation, when the (?i) prefix is missing. An unescaped dot or question mark, which quietly matches something other than the literal character. Or an anchor on the Page dimension, where ^ has to start at https:// because the dimension holds the full URL rather than the path.

Does the regex work in the Search Console API too?

Yes. The Search Analytics API accepts the same RE2 patterns through a dimensionFilter using the includingRegex and excludingRegex operators, which mirror the two match types in the interface. Patterns copied from this generator can be pasted straight into an API request body.

Stop rebuilding the same filters every month

CrawlRaven joins your Search Console and GA4 data to a 200-point crawl and ranks every fix by the traffic behind it, so the segments you build by hand arrive already sorted.