Useful Google Search Console Regex (Re2) That I Use Every Day

SEO

Author: Mike Ciffone

Published: 12.27.2021 / Updated: 03.29.2024

Without regex, finding what you want in the performance tab is a chore. Most of the time, we are checking to see differences in impressions, average position, or clicks for specific pages or keywords. Here’s an easy-to-remember list of commands that will help you filter out the noise and get the SEO insights you care about faster.


#################################################################################
# Running List as of 04/16/2021
# Uses Re2 so PCRE-style backreferences and look-around assertions are not supported
# -------------------------------------------------------------------------------
# Refrence:
# https://github.com/google/re2/blob/master/doc/syntax.txt
# https://search.google.com/search-console
##################################################################################

# Matches URL slug
^[foo]+(?:-[bar]+)*$

# All urls within /page 
(http|https):\/\/www.example.com\/page\/.*

# All urls between a certain slug and ending
(http|https):\/\/www.example.com\/slug\/[^\/]+\/page

# Matches all queries containing a specific term (all work)
\b(\w*foo\w*)\b
\b(\w*foo\sbar\w*)\b
^hello\sworld$

# Matches all queries containing "blue shoe" or "blue shoes"
(\W|^)blue\s{0,3}shoe(s){0,1}(\W|$) //works

# Matches all queries that contain "Ciffone" or "Ciffone Digital"
^.*(ciffone|ciffone digital).*$

# Match Word or Phrase in a List
(?i)(\W|^)(foo|bar|foo\sbar)(\W|$)
    

Want to Add to the List?

Submit a contribution via the form below.

Name
This field is for validation purposes and should be left unchanged.