Created
April 16, 2021 13:15
-
-
Save mikeciffone/b6bad66672075386b4b267021727ef45 to your computer and use it in GitHub Desktop.
Useful Google Search Console Regex (Re2)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
################################################################################# | |
# 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|$) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment