Regex for Google Search Console

Test a regex filter before you use it in Search Console.

Choose the engine and write the pattern, then paste queries or URLs from your report. See what shows, what's left out, and why, before you apply the filter.

Engine
Filter

Search Console ignores letter case by default and matches any part of the text. Start with (?-i) to make it case-sensitive.

Result

Type a pattern and at least one line.

What the pattern means

  1. ^Start of the text
  2. (كيف|ماذا|لماذا|ليش|متى|وين|أين|اين|هل|ما هو|ما هي|كم)One of: كيف, ماذا, لماذا, ليش, متى, وين, أين, اين, هل, ما هو, ما هي, كم
  3. (Start of a group
  4. The text “ ”
  5. |Or: either side may match
  6. $End of the text
  7. )End of the group
The same pattern in JavaScript
/^(كيف|ماذا|لماذا|ليش|متى|وين|أين|اين|هل|ما هو|ما هي|كم)( |$)/ui
Symbol cheat sheet
SymbolMeaningExample
.Any single characterb.g
\dA digit (0-9)\d{4}
\wAn English letter, digit or _\w+
\sWhitespaceseo\s+tools
\p{Arabic}An Arabic letter (Search Console)^\p{Arabic}+$
[abc]One character from the list[أإا]فضل
[^abc]A character not in the list[^0-9]
a|bThis or thatسعر|اسعار
( )A group(best|top) seo
?Optionale-?mail
*Zero or more/blog/.*
+One or more\d+
{2,5}2 to 5 times\w{2,5}
^Start of the text^كيف
$End of the text/$
\.A literal dot (likewise \? and \+)\.html$
(?-i)Case-sensitive (Search Console)(?-i)SEO

How to use it

  1. 1

    Choose the engine

    Search Console uses RE2, which differs from Python and JavaScript in ways that matter.

  2. 2

    Write a pattern or pick one

    Questions, queries without your brand, long queries, pages in one section, and more.

  3. 3

    Paste your lines and review

    Each line is marked as shown in the report or not, with the matching part highlighted.

01 / LINKAZA TOOLS

Search Console's rules

Search Console uses RE2 syntax, ignores letter case by default, and matches any part of the text. To make a filter case-sensitive, start the pattern with (?-i).

02 / LINKAZA TOOLS

What RE2 doesn't support

No lookahead or lookbehind such as (?!…), and no references to earlier groups such as \1. To leave queries out, use the filter's “Doesn't match regex” option instead.

03 / LINKAZA TOOLS

Careful with Arabic

In RE2, \b and \w only know English letters, so they don't work around Arabic words. Use a space or the start and end of the text, and \p{Arabic} for Arabic letters.

Frequently asked questions

01Is my text sent to a server?

No. The test runs in your browser; neither the pattern nor your lines reach our servers.

02Why does my pattern match everything?

Usually a | at either end or a || in the middle, which means “or nothing”. The tester warns you when it finds one.

03Is the result exactly what Search Console shows?

The tester follows RE2's important rules in your browser; rare cases may differ. Try the filter in your report after testing.

04“Matches” versus “Doesn't match”?

“Matches” shows the lines the pattern matches; “Doesn't match” shows everything else, such as queries without your brand.

05Why did the test stop?

Some Python and JavaScript patterns can run for a very long time because of nested repeats like (a+)+, so we stop them. RE2 is designed to avoid that.

More free tools

START BY COMPARING PUBLISHERS

Find a publisher and review the offer.

Compare language, traffic, and prices, then place your backlink or guest post order from a free account.

Create a free accountReview publishers and offer terms before ordering