ToolsThatRank / Search Console regex tester
Tester with rules quoted from Google's help page
Search Console regex tester with an RE2 check
Custom (regex) filters in Search Console use RE2 syntax. The match is partial, so the expression can match anywhere in the query or URL unless you use ^ or $. The match is not case-sensitive unless the expression starts with (?-i). Paste your rows below, enter the expression and see which rows match. The tester stops on RE2 syntax that is not supported, such as lookahead.
Updated 2026-11-08
A pattern that works in a JavaScript regex tester can fail in Search Console. The engine is RE2, the match is a partial match, and the default is case-insensitive. This page quotes the rules from Google's help page and lets you test an expression on your own queries and URLs in the browser.
By Michael Lip, an independent full-stack consultant who builds and runs ToolsThatRank.
The rules, quoted from Google's documentation
The quotes come from the Search Console help page Performance report (Search results): Advanced filtering and comparison, the RE2 syntax wiki and the Search Analytics API reference.
| RULE | WHAT THE DOC SAYS | WHAT IT MEANS FOR YOUR FILTER |
|---|---|---|
| Syntax | "The RE2 syntax is used." | The RE2 syntax page marks lookahead, lookbehind and backreferences NOT SUPPORTED. The tester names them and shows no result. |
| Match type | "Default matching is a 'partial match.' Your regular expression can match anywhere in the target string unless you use ^ (start of string) or $ (end of string)." | shoe matches "shoes for men". ^shoe$ matches only the query "shoe". |
| Case | "Default regex matching is not case-sensitive. You can prepend (?-i) to the beginning of your expression for case-sensitive matches." | (?-i)AAA matches /AAA but not /aaa. Use it when URL casing is meaningful. |
| Multiple values | "For multiple values, separate them with a vertical bar (|) and surround the whole expression with parentheses" | (red|blue|green) follows that shape. Leave out the spaces that the help page shows around each |, because a space in the expression matches only a space. (red | blue) does not match the query "blue", because it looks for a space before blue. |
| API filters | The Search Analytics API reference describes dimensionFilterGroups[].filters[] with "Max length 4096 characters." Its operator includingRegex is "RE2 syntax regular expression that must be matched." | The help page for the report filter states no length limit. The API reference does not state a case rule for includingRegex or excludingRegex. |
| Exclude | "If you want to see all values except the specified values, choose Doesn't match regex" | The same expression inverts. Build it to match what you want gone. |
The help page's example for case is that (?-i)AAA will match https://example.com/AAA but not https://example.com/aaa.
Test a regex on your own rows
Paste your queries or URLs, enter an expression, and the page lists the rows that match and the rows that do not match. Matching runs in JavaScript, not in RE2. The tester first checks the expression for RE2 syntax that is not supported. Then it translates the RE2 forms that it knows, such as \z and [[:alpha:]]. If it cannot check a construct, it says so and shows no result. RE2 itself is case-sensitive by default. The Search Console report filter is not case-sensitive by default, and the tester uses the report rule.
The example rows are not data from a real property. The first three contain spelling variants from Google's 2021 blog post. The fourth row is a near miss that the blog's expression does not match. Paste your own rows. The tester removes spaces at the start and end of each line and reads the first 5,000 lines that are not empty. If a line has a tab (a pasted table), the tester uses the text before the first tab.
The tester runs in your browser. It is a pre-check, so confirm the result in Search Console. It uses the report defaults: a partial match unless you use ^ or $, and no case sensitivity unless the expression starts with (?-i). Before it runs a pattern, it looks for syntax that the RE2 syntax page marks NOT SUPPORTED, for example lookahead, lookbehind, backreferences and possessive quantifiers. It also stops on repetition counts above 1000. The same page lists that limit as an implementation restriction. Then it names the construct and shows no result.
Rows that match the expression
Rows that do not match the expression
Build a pattern
The button joins the lines with | and escapes punctuation such as . + ( ).
The two query intent buttons use the examples from Google's 2021 blog post.
API filter for the expression in the tester. Matches regex gives the operator includingRegex. Doesn't match regex gives excludingRegex. The API reference does not state a case rule for these two operators.
Four expressions to start from
Brand queries, exact set
^(acme tools|acme inc)$ with anchors matches only those two queries, not "acme tools review". Without the anchors, the partial match keeps every query that contains either phrase.
Question queries
^(how|what|why|when|who|which|where)\b catches queries that begin with a question word. The \b word boundary keeps "however" out and still matches the query "how". The doc's wildcard list covers ^ as the start-of-string anchor.
URLs by directory
^https://example\.com/blog/ keeps every URL under /blog/. The backslash makes the dot match only a dot. In "Doesn't match regex" mode the same expression removes the blog from the report.
Case-sensitive paths
(?-i)/Download/ matches /Download/ but not /download/. The doc's own example is (?-i)AAA on https://example.com/AAA. This expression uses the same prefix on a directory.
The filters above use alternation, anchors, an escaped dot, the (?-i) prefix and literal text. Test each one on your own rows above, then confirm it in Search Console.
What this page cannot tell you
- It does not run Google's RE2 engine. The tester implements the documented defaults in the browser; for the full grammar, the RE2 wiki is the reference.
- It does not check a length limit. The help page for the report filter does not state a limit.
- It cannot know which rows your property returns. The example rows are not your data.
- A query filter in the report leaves out anonymized queries. Google's help page says that filtering by query or URL "can affect the report totals due to data truncation and the omission of anonymized queries." For the size of that gap, see hidden queries in Search Console.
How this page was checked
The rules table quotes the Search Console help page "Performance report (Search results): Advanced filtering and comparison", the RE2 syntax wiki and the Search Analytics API reference. The tester's defaults (partial match, not case-sensitive, (?-i) prefix) follow the help page. The list of constructs that the tester stops on comes from the NOT SUPPORTED lines and the repetition count restriction of the RE2 syntax wiki.
Sources:
support.google.com · Performance report (Search results): Advanced filtering and comparison
developers.google.com · Search Central blog, June 2021, regex negative match
github.com/google/re2 · RE2 syntax
developers.google.com · Search Analytics query reference
The example rows are not data from a real property. The rules on this page come from the sources above. They are not measurements.
The pipeline
Build tool pages like this one on your own niche
ToolsThatRank is the pipeline I build my tool sites with. You give it a niche and it builds a working tool, and it stops a page from shipping when a number will not verify. It costs $99 once, with a 14-day refund and no questions asked.
Michael
