Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Regex using GSC and Including multiple words.

         

traffik daddy

5:21 pm on Jun 1, 2021 (gmt 0)

10+ Year Member



Hi all, I hope somebody can help as I don't know a lot about regex. I'm trying to understand it better in Search Console Performance data using the 'Custom (regex)' filter, and I want to filter down the Queries results to include 3 singular keywords and it shows all Queries containing all 3 words in any order.

I don't want to use the OR operator, I am basically looking for an AND operator, if there is one.

For example - I want to use 'blue', 'widgets' & 'sale' and it shows back Queries like 'Where can I find blue coloured widgets for sale?'.

Is it possible?
Thanks in advance :)

lucy24

4:00 pm on Jun 2, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Tricky though not impossible. What makes it tricky is that there isn’t an AND operator as such; you have to list all three:
word1.*?word2.*?word3
All those ? (meaning “stop as soon as you can”) are probably not necessary for Search Console purposes, unless you are passionately concerned about saving G’s computer a few picoseconds.

But this only works if the three words occur in that order. For three words, if they can occur in any order, you would have to set down six separate permutations, and then put those into an OR group, like
(word1.*?word2.*?word3|word1.*?word3.*?word2|word2.*?word1.*?word3|word2.*?word3.*?word1|word3.*?word1.*?word2|word3.*?word2.*?word1)
If one word pair really is something like “blue widgets” you could probably safely assume that they will always occur together and in that order, letting you collapse them into “blue widget”. (Or “widget.+?blue" if the site is in an adjective-first language.) But there’s no limit to how fancy you can get: say,
(word1.*?(word2.*?word3|word3.*?word2)|word2.*?(word1.*?word3|word3.*?word1)|word3.*?(word1.*?word2|word2.*?word1))

Gosh. That was fun. Disclaimer: I couldn't find the relevant tab in GSC, so I don't know if any of that would actually be allowed.

not2easy

4:08 pm on Jun 2, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Might make a difference?
Today GSC has updated the Regex filters: [webmasterworld.com...]

NickMNS

4:17 pm on Jun 2, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



In GSC in "Performance" select Queries, then to the right of the screen there is hamburger like menu icon but each line is a bit shorter, like a down arrow. That's a filter symbol, didn't you know? A funnel menu, I guess...

I tried the Regex but it doesn't accept it, it uses it as plain text.

But! Google analytics to the rescue.
"Acquisition" => "Organic" then you get the default view showing the "keyword" tab. Click advanced filter, then from the second drop down select "matching RegExp", enter the expression and voila!

NickMNS

4:26 pm on Jun 2, 2021 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



@not2easy I was going to post "not in my account." But after looking more closely I found it, you have to click the "+ New" button at the top. And yes it is a button, of course wouldn't know that if you don't hover over it, but hey should we be surprised from the people that brought you the "funnel burger" icon.

Edit: I just went back to the page, I noticed there is a "funnel burger" icon at the top left. So I guess it should have been obvious, "funnel burger" == filters. But despite being the exact same icon and interface ( ie: no additional button styling) that funnel-burger is not clickable. Wow I really need to brush up on my UI skills.

not2easy

5:23 pm on Jun 2, 2021 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



True but for the OP here, the "keyword" tab would at least bring a better list to sort via Regex than queries when their goal is keywords.