Long-tail keywords: Using Regex in Google Search Console

05/05/20214 min read.

Google now offers you more ways to slice and dice your organic search data in Google Search Console, and with the help of Regex, you can uncover some pretty valuable long-tail keywords and search queries.

Google recently announced a couple of improvements to the Google Search Console performance reports. The improvements include support for regular expressions within the filters of the performance reports, and also, the comparison mode has improved its data filtering.

What are Regular expressions?

We’ve been expecting Google Search Console to support regular expressions for the past year or so, and now it’s here. Regular expressions, also known as regex, can help you do an advanced search and replace strings of words or characters.

You can find this option under a query or page filter in the performance report. Select the dropdown menu, and select”Custom.” This option will let you create a more complex query and page-based filter.

The example Google provided was “Let’s say your company is called ‘cats and dogs’ but is sometimes also abbreviated as ‘cats & dogs’ or even ‘c&d‘. You can use a regex filter to capture all of your branded queries by defining the regex filter:

cats and dogs|cats & dogs|c&d

Here is what it looks like:


An update to Search Console’s performance report help page notes the following about using regex filters:

  • Search Console defaults to partial matching, meaning the regular expression can match anywhere in the target string unless it contains the characters ^ or $ to require matching from the start or end of the string, respectively.
  • Reports default to case-sensitive matching. Site owners can specify (?i) at the beginning of the regular expression string for case-insensitive matches. Example: (?i)https.
  • Invalid regular expression syntax will return no matches.

For further assistance with creating regex filters, Google points to a live testing tool that you can find here.

Question queries-how to get them using Regex?

Here’s the regular expression for finding questions that begin with “who, what, where, when, why, how, was, did, do, is, are, aren’t, won’t, does, if.”:

^(who|what|where|when|why|how)[" "]

And a more complex one:

^(who|what|where|when|why|how|was|did|do|is|are|won’t|were|weren’t|shouldn’t|couldn’t|cannot|can’t|didn’t|did not|does|doesn’t|wouldn’t)[" "]

Use this regex to help you find the search questions with high impressions and beef up your answers.

Revamped comparison mode

You may have already been using the comparison mode to answer comparison-based questions. Previously, if you selected more than one metric, the table wouldn’t contain a comparison column with the relative percentage difference.

Following Google’s announcement, the comparison mode now fully supports cases where more than a single metric is selected. They’ve improved the interface to make it easier to view those results side-by-side, almost doubling the area available for the data table. In addition, the comparison mode now supports the new regex filter for queries and pages.

comparison report in gsc

More ways to slice and dice the performance report in Google Search Console

With the addition of regex support and now the comparison report data filtering improvements, you can dig even deeper into your Google Search organic traffic data and get those infamous long-tail keywords or more precise and intentful queries.

How to get long-tail keywords in the Google Search Console?

To get the queries with 6 or more words, copy this snippet:

([^" "]*s){5,}?

And paste into:

Showing the GSC query field

For queries over 14 words, copy this snippet:

([^" "]*s){15,}?

And paste into:

An example GSC query input

This regex will give you a list of all the search queries with more than 15 words.

Final Notes

These longer search queries can sometimes bring over 100 intentful visits per month. The beauty is that there is less competition because other SEOs and content writers are probably ignoring them due to low search volume. So to summarize: Don’t trust search volume metrics completely and utilize the power of regex to sort through an endless pool of queries.

Thank you for reading, and see you next time.

© 2023, Marko Bodiroža. This website does not track you, or use any analytics software. Privacy Policy