Regex examples for Google Search Console.
Use these to find hidden gem potential keywords to write a full article on, or see where you can add more content to improve your niche coverage. Here is how to enter a custom regex in search console.
- Open google search console
- Click “performance”
- Click “new”
- Click “query”
- Select “Custom (regex)” from dropdown
- Type in your chosen (modified for your own use) regular expression below in the keyword field
List Search Phrases including a Specific Keyword
^apple$
Matches queries that are exclusively “apple.”
List Search Phrase Beginning with a Specific Word
^apple
Matches queries that start with “apple” (e.g., “apple pie”, “apple orchard”).
List Search Phrase Ending with a Specific Word
apple$
Matches queries that end with “apple” (e.g., “green apple”).
List Search Phrases Containing a Specific Word Anywhere
apple
Matches queries that have “apple” anywhere (e.g., “apple pie”, “caramel apple”).
List Search Phrase Excluding a Specific Word
^(?!.*apple).*$
Matches queries that don’t have the word “apple.”
List Search Phrase with Multiple Words (OR condition)
apple|orange|banana
Matches queries containing either “apple,” “orange,” or “banana.”
List Search Phraseof a Specific Length in words
^.{5}$
Matches queries that are exactly 5 characters long.
List Search Phrase with Numbers
\d
Matches queries that contain any number.
List Search Phrase without Numbers
^[^\d]*$
Matches queries without any numbers.
List Search Phrase with Specific Prefix and Suffix
^apple.*pie$
Matches queries that start with “apple” and end with “pie.”
List Search Phrase with Two Words Only
^\w+\s\w+$
Matches queries with only two words.
List Search Phrase Containing Special Characters
[!@#$%^&*()]
Matches queries with any of these special characters.
List Search Phrase Excluding Multiple Words
^(?!.*\b(apple|orange|banana)\b).*$
Matches queries that don’t have “apple,” “orange,” or “banana.”
List Search Phrase with Variations of a Word
\bapples?\b
Matches queries with “apple” or “apples.”
Match Queries with Hyphenated Words
\b\w+-\w+\b
Matches queries with hyphenated words like “self-employed.”
Match Queries with Exact Phrase
^apple pie recipe$
Matches only the query “apple pie recipe.”
Keywords Excluding Special Characters
^[^!@#$%^&*()]*$
Matches queries without any of these special characters.
Match Multiple Word Variations
\b(baseball|basketball|football)\b
Matches queries containing “baseball,” “basketball,” or “football.”
Match Queries with 3 Words or More
^(\w+\s){2,}\w+$
Matches queries with 3 words or more.
Match Long Tail Keywords (5 words or more)
^(\w+\s){4,}\w+$
Matches queries that have 5 words or more.
Remember, when using any regex in Google Search Console, it’s important to double check your regex to be sure they are providing the data you want accurately. Adjust as needed based on your specific requirements and website’s content