Free tool
Regex Tester for Search Console, Python and JavaScript
Write a and try it on your Search Console queries or page URLs. You see right away what it matches and what it doesn't, with every part of the pattern explained.
Test the pattern as it runs in
One query or URL per line, and you see which lines the filter keeps, exactly as Search Console would.
Ready-made Search Console patterns
One query or URL per line; you can paste them straight from Search Console's Performance report.
Result
Pattern explained
^start of the text(how|one of these words: how, what, why, when, where, who, which, can, does, do, is, are, shouldwhat| why| when| where| who| which| can| does| do| is| are| should) \sa space, a line break or a tab
Regex rules in Search Console
It runs RE2
That's why it rejects patterns with lookaheads, lookbehinds or backreferences, and this tester warns you before you try them there.Matching is partial
The pattern only has to appear somewhere in the query or URL. To match the start, use
^; to match the end, use$.It ignores case
Search Console treats upper and lower case as the same, unless the pattern starts with
(?-i): then/Blog/and/blog/are different.Matches or doesn't match"Matches regex" keeps what the pattern matches, and "Doesn't match regex" drops it, which is handy for leaving out your brand name, for example.
Source: Search Console Help
Regex cheat sheet
Click any example to try it in the tester.
^- Start of the text
$- End of the text
|- Or
( )- Group
.- Any one character
*- Any number of times, or none
+- Once or more
?- Optional
{4,}- 4 times or more
[ ]- One character from a set
[^ ]- One character not in the set
\d- A digit
\s- A space
\S- A non-space
\.- A real dot
\b- An English word boundary
(?-i)- Case-sensitive
Free course
Learn Regex for Search Console, step by step
Ten lessons that start with the first pattern you write and end with a full analysis of an online store's data, each with exercises you try in your browser.
Regex FAQ
What is regex?
A regular expression, or regex, describes what the text you're looking for looks like instead of spelling it out. Instead of listing every question that starts with how or what, you write ^(how|what) and it matches every query that starts with either. That's why SEOs use it in Search Console and Google Analytics filters, and for data analysis in Python.
How do I use regex in Search Console?
Open the Performance report, add a filter on queries or pages, pick Custom regex, type the pattern, and choose Matches or Doesn't match. Test the pattern here first to make sure it matches what you want.
Why does my regex work here but not in Search Console?
First make sure you picked Search Console in the tester: Python and JavaScript support syntax RE2 rejects, like lookaheads and backreferences. Then remember that Search Console ignores case unless the pattern starts with (?-i). We go through it in detail in the regex debugging lesson.
Is regex in Python different from Search Console?
The basics are the same, like ^, $, |, groups and repeats, but Python supports things RE2 doesn't, like lookaheads and backreferences, and it's case-sensitive unless you use IGNORECASE. So pick the engine you'll actually run the pattern in. Writing it for code? Try the Python regex tester or the JavaScript regex tester.
Does the tester keep the text I test?
No. Testing happens entirely in your browser, and the text is never sent anywhere. Only the description you write for the AI to write a pattern is sent to OpenAI to write it, and we don't keep it.
Is the tester free?
Yes. Testing is free with no limit, and every visitor gets 15 tries a day to have AI write a pattern.