Custom Regex In Google Search Console

Using the “Custom Regex” filter in Google Search Console has been a huge help for our progressive optimisation team.

If you are not using the Custom (regex) query option you are going to love this article.

The SEO community have been waiting a long time for Regex and now it is available inside your Google Search Console accounts.

We will explain amazing use cases and best practices on how to use the Custom Regex” filter in GSC.

Why Use Custom Regex In Google Search Console?

The main reason to use Custom Regex is that it saves time sifting through data and analysing it Google Search Console.

Regex helps a great deal with SEO Automation.

With the ability to automate many literal search queries you are able to complete this with a single custom regex string of characters.

Best Custom Regex Queries

Here are some amazing use cases using the “Custom Regex” filter in Google Search Console.

Identify Question Queries

Carrying out the content expansion technique of finding question queries to ask and answer in your content has contributed to huge growth to our websites.

Identifying the questions users are asking and answering them directly helps you grab those featured snippets time and time again.

Our SEO content writers love using People Also Ask and marketmuse to expand question queries, but now have another strategy using the google regex search feature.

You need to do the following to identify all the question queries:

  1. Open google search console
  2. Click “performance”
  3. Click “new”
  4. Click “query”
  5. Select “Custom (regex)” from dropdown
  6. Type in the regular expression below in the keyword field

Custom Regex in Google Search Console

Here is the regular expression search parameter for finding questions:

^(who|what|where|when|why|how|was|did|do|is|are|aren’t|won’t|does|if|can|could|should|would|will|were|weren’t|shouldn’t|couldn’t|cannot|can’t|didn’t|did not|doesn’t|wouldn’t)[” “]

With this information from the regular expression search, you identify questions your website is showing impressions for you can then improve the answers on.

Queries That Begins With Specific Keyword

To find queries that begin with a particular keyword or keyphrase you need to do the following:

  1. Open google search console
  2. Click “performance”
  3. Click “new”
  4. Click “query”
  5. Select “Custom (regex)” from dropdown
  6. Type in “^keywords”

You have to add the regular expression (^) at the beginning of the query and apply.

If you add the keywords in “queries containing” then it also shows queries like “ultimate guide to keywords” which is not what I may want to see.

This regular expression parameter is to find queries beginning with specific terms.

The most popular google regex searches for this is:

  • ^Best
  • ^Top
  • ^Brand Name
  • ^List

Queries That End With Specific Keyword

To find queries that end with a particular keyword or keyphrase you need to do the following:

  1. Open google search console
  2. Click “performance”
  3. Click “new”
  4. Click “query”
  5. Select “Custom (regex)” from dropdown
  6. Type in “keywords$”

You have to add the regular expression ($) at the end of the query and apply.

Queries With Two or More Keywords in the Search String

To find queries with two or more keywords in the search string you need to do the following:

  1. Open google search console
  2. Click “performance”
  3. Click “new”
  4. Click “query”
  5. Select “Custom (regex)” from dropdown
  6. Type in “abc.*xyz”

You have to add the regular expression (.*) in between the two keywords of the query and apply.

You will only find those search queries that contain both of the keywords used in the google regex search string.

Find Longtail Keywords

To find longtail keywords you need to do the following:

  1. Open google search console
  2. Click “performance”
  3. Click “new”
  4. Click “query”
  5. Select “Custom (regex)” from dropdown
  6. Type in “([^” “]*\s){6,}?”

You have to add the regular expression (([^” “]*\s){6,}?) in the query and apply it to find all longtail keyphrases with 7 or more keywords in the search string.

The number six in the particular strings of characters means you only want phrases that has MORE THAN six keywords.

You can edit the number six in the google regex search string to whatever numerical value you prefer as this just filters how many keywords in the search string you would like to apply.

Popular Questions

How do I search for a regular expression?

To search for regular expression you need to use the pattern matching search characters.

With RegEx, you can use pattern matching to search for particular strings of characters rather than constructing multiple, literal search queries.

I highly suggest using https://regex101.com/ to test regular expression search queries.

What is RE2 regex?

RE2 regex is the software library used for Custom Regex In Google Search Console.

RE2 was implemented by Google and provides a C++ interface.

RE2 is a software library for regular expressions via a finite-state machine using automata theory, in contrast to almost all other regular expression libraries, which use backtracking implementations.

Common Regular Expressions

Here are a few basic regular expressions:

  • (.) Wilcard – Matches any single character e.g. “m.n” matches “men” and “man” but not “men”
  • [characters] Wilcard – Matches any single item inside [ ] e.g “c[aie]t” matches “cat”, “cit”, and “cet” or “i[o0-9]n” matches “ion” and “i7n” but not “ian”
  • (*) Wilcard – Matches the preceding letter or pattern zero or more times e.g “fo*d” matches “fd”, “fod”, “food”, and “foooooooood”
  • (+) Wilcard – Matches the preceding letter or pattern 1 or more times e.g. “fo+d” matches “fod”, “food”, “foooooooood” but not “fd”
  • (|) Wilcard – OR operator matches either the expression before or after the | operator e.g. “New York|San Francisco” matches both “I love New York” and “I love San Francisco”
  • (^) Wilcard – At the start of your expression, limits match to the start of the target string e.g. “^example” matches “example” but not “an example”

Regular Expression Filter

The Performance report shows important metrics about how your site performs in Google Search results. Here are the google webmasters guide to Performance report (Search).

If you choose the Custom (regex) filter, you can filter by a regular expression (a wildcard match) for the selected item. You can use regular expression filters for page URLs and user queries. The RE2 syntax is used.

  • You can choose whether to show strings that do match your regular expression or that don’t match your regular expression. Default is to show strings that do match your regular expression.
  • The default matching is “partial match”, which means that your regular expression can match anywhere in the target string unless you use ^ or $ to require matching from the start or end of the string, respectively.
  • Default matching is case-sensitive. You can specify “(?i)” at the beginning of your regular expression string for case-insensitive matches. Example: (?i)https
  • Invalid regular expression syntax will return no matches.
  • Regular expression matching is tricky; try out your expression on a live testing tool, or read the full RE2 syntax guide

Summary

Using the Custom Regex in GSC to identify longtail search queries, questions or branded search is a huge help to content marketers in September 2021.

Saving time with the regular expression search gives your team more time to integrate it into all content audits carried out.

We have given you the exact google search regular expression queries our team use on a daily basis.

As Google now recognises regular expressions (regex) for querying search console let us know if you are using any additional query use cases not included in this article.