GSC Regex Builder and Tester
Build Search Console regex from plain words and test it against real queries before you use it.
How to use it
- Pick a pattern and type your words, one per line. The regex builds itself.
- Edit the regex directly if you want to fine-tune it.
- Paste your real queries into test queries to see exactly what matches before you use it.
- Copy the regex into Search Console: open the Queries filter, choose Custom (regex), and paste.
What it does, and what it does not
It does: build common Search Console regex patterns - contains, starts with, exact, exclude and question queries - and test them live against your sample queries so you know they work before you rely on them.
It does not: perfectly replicate RE2. Search Console uses Google RE2, which has no lookahead; your browser does. The tool warns you when a pattern uses lookahead and shows an RE2-safe alternative in the reference.
Reference
Search Console lets you filter queries and pages with regular expressions, which turns a flat keyword list into real analysis: brand versus non-brand traffic, question queries, everything in one folder, all searches mentioning price. The catch is that the regex box is unforgiving and uses a specific engine, so a pattern that looks right can silently match nothing. Building and testing it first saves a lot of confusion.
Search Console uses RE2, Google's own regex engine. RE2 is fast and safe but deliberately leaves out one feature people reach for: lookahead and lookbehind. That matters for the common "does not contain" filter. You cannot write ^(?!.*brand) in Search Console - it will error or match nothing. Instead, RE2 has a built-in switch: tick the "Doesn't match regex" option in the Search Console filter and give it a simple contains pattern like (brand|companyname). That inverts the match without any lookahead. This tool's tester runs in your browser, which does support lookahead, so it flags when your pattern uses it and points you at the invert-the-filter approach.
Matching in Search Console is partial and case-insensitive by default: seo matches "best seo agency" anywhere in the string. Anchor with ^ for starts-with and $ for ends-with. Escape characters that have regex meaning - a literal question mark or full stop needs a backslash. Group alternatives with (a|b|c). Build the pattern here, paste your actual queries into the tester to confirm it catches what you expect and ignores what you do not, then move it into Search Console with confidence. A regex that is wrong in the same subtle way every day quietly distorts every report you build on it.
Questions
Why does my "does not contain" regex fail in Search Console?
Because RE2, the engine Search Console uses, has no lookahead, so ^(?!...) does not work. Instead, use a simple contains pattern and switch the filter to "Doesn't match regex". That inverts it without lookahead.
Is Search Console regex case-sensitive?
No, it is case-insensitive by default and matches partially, so price matches anywhere in the query. Anchor with ^ or $ when you need starts-with or ends-with.
How do I use the regex once built?
In Search Console, open the Queries (or Pages) filter, choose Custom (regex), paste the pattern, and pick "Matches" or "Doesn't match".
Why does the tester allow lookahead but Search Console does not?
The tester uses your browser regex engine to give instant feedback, and it supports lookahead. Search Console uses RE2, which does not. The tool warns you when your pattern relies on lookahead.
Are my queries uploaded?
No. The pattern and tests run entirely in your browser.