Branded vs Non-Branded Queries in Search Console with Regex

About 26 minutes

Up to the last lesson, we were learning how regex reads the shape of a query: we learned to search for several options, (price|cost|how much), to control the start and the end, ^how, and to set the query's length, ^\S+(\s+\S+){6,}$. Today we start using these in real SEO work. We'll say: I have thousands of queries in front of me; how do I split them into groups that help me understand performance? That's what we call segmentation.

What's a segment, anyway?

Say you have 20,000 queries in Search Console. It doesn't make sense to treat them all as one block. Sometimes you want to see: brand queries, non-brand queries, queries phrased as questions, price queries, comparison queries, buying queries, long queries, queries with models or numbers. Each of these groups is a segment: a part of the data we gathered because it shares a particular trait. Regex helps us build the group; then the SEO analysis begins.

The rule
A segment doesn't mean a confirmed intent. If you write (price|cost|buy) and call the results commercial queries, regex only said "this query has price in it" or "has buy in it". You, the SEO, decided those words are a signal. Regex does pattern-based segmentation, not semantic classification.

Let's start with the most important segment: brand queries

Say we have a made-up brand called Tech Zone, and people search for it in different ways. If we used just tech zone, we'd lose techzone, tech-zone and the typo teck zone. So we could start with:

Matches regex(tech zone|techzone|tech-zone|teck zone)
  • tech zone
  • tech zone laptop
  • techzone offers
  • tech-zone
  • teck zone uk
  • best laptop uk
  • macbook price

If the result looks like that, we have a first brand segment. Focus on the word first, because we still need to review the data and see whether we forgot any variations. The right way to work: the known brand name → a first pattern → review the actual queries → find new variations → adjust the pattern → test again.

And non-brand?

Here's something really neat. We don't need a new regex. Exactly the same pattern, but instead of Matches regex we use Doesn't match regex: leave out any query that contains a form of the brand.

(tech zone|techzone|tech-zone|teck zone)Doesn't match regex
  • tech zone
  • tech zone laptop
  • techzone offers
  • tech-zone
  • teck zone uk
  • best laptop uk
  • macbook price

And that's a very important comparison in SEO: you might find that brand has strong clicks, CTR and position, while non-brand has high impressions, a low CTR and a middling position. Then the picture is completely different from looking only at the overall numbers.

Watch out
Watch out for an important mistake: if the brand regex is incomplete (say we forgot "teck zone") and we then use it with Doesn't match regex, the query "teck zone prices" ends up in our non-brand segment even though it's a brand query. So one small mistake in the brand pattern spoils both, the brand segment and the non-brand segment, at the same time. A segment is only as good as the rule you built.

Another important segment: queries phrased as questions

Want to know what users ask the site about? We can start with a set of question words: how, can, why, when, where, what. If we write (how|can|why|when|where|what), that means the word is anywhere. But if our goal is queries that start with a question, we use what we learned:

Predict the result

You want the queries that start with one of these question words. How many of the six will match?

^(how|can|why|when|where|what)
  • how to choose a laptop
  • can a macbook run windows
  • why does my laptop overheat
  • how much is a macbook
  • best laptop for work
  • laptop how to choose one

Have we got every question now? No. A user might type "which laptop is best for design" or "is a macbook worth it". The first pattern isn't complete, and that isn't a fault in regex: we described a particular set of patterns. We can widen it after reviewing the data: ^(how|can|why|when|where|what|which|is|should). Same mindset: a first pattern → review the results → find what you missed → widen the pattern.

The comparison segment

We have: macbook vs windows laptop, macbook versus dell, difference between macbook air and pro, macbook or windows, best macbook for work, macbook price.

The word "or" is a useful comparison signal, but look at what happens if we write it bare: "or" is inside "for" and inside "work".

or, bare(vs|versus|difference between|or)
  • macbook or windows
  • best macbook for work
  • macbook price

Remember from lesson 1 that a space is a character? So we write "or" with a space on each side, ( or ): the word or, on its own, between two words.

(vs|versus|difference between| or )
  • macbook vs windows laptop
  • macbook versus dell
  • difference between macbook air and pro
  • macbook or windows
  • best macbook for work
  • macbook price

That's a very useful segment for e-commerce, SaaS and service sites: any field where the user is choosing between two alternatives. But this is where the problem of false positives starts:

(vs|versus|difference between| or )
  • does the price include tax or not

That's a false positive: a result that matched the pattern but doesn't belong in the segment we're building. The more you widen a regex so you don't miss results, the more extra results can creep in. And the reverse is true too.

The rule
There's no magic regex called comparison intent. No pattern knows the user's intent completely. We build a proxy: a set of signals (vs, versus, difference between, or, compare), and then we review the results. Every addition needs a reason; don't add words just to make the regex look bigger.

The price segment, and the buying segment

(price|pricing|cost|how much|cheap) is a segment we use to answer questions like: which pages show up for price queries? Do users who ask about price have a higher CTR? Notice the difference: we're not saying "I made a price regex, done"; we're saying "I built a segment, and I want to use it to answer a question".

Do we add "price" to the buying segment, (buy|order|finance|discount|deal|for sale)? It depends on the question we're trying to answer. If we're making a broad segment called commercial modifiers, it could go in. But if we're trying to pin down the queries closest to the purchase itself, it's better to keep them apart: a price segment on its own, a buying segment on its own.

Watch out
Don't lump different things together just because they're close. If you put price, comparison, buying and informational questions all in one regex and look at the CTR, what does the number mean? It's unclear, because you mixed four different intents in one segment. Good segmentation isn't "how many words can I fit in one regex?" but "which group, when I compare its metrics, will give me useful information?"

Instead of saying "I want a price regex", say "do price queries get a different CTR from the rest of the queries?" Then you know why you're building the group.

The ? symbol means the previous part is optional

Say the brand name is SEO Lab, and people type seo lab and seolab. The difference between them is one space. Do I have to write both forms in full? Not necessarily. If you write ? after a character or a part, it means: the previous part may appear once, or not at all.

seo ?lab
  • seo lab
  • seolab
  • seo labs
  • best seo lab
Watch out
Does ? mean "anything optional"? No, that's a common mistake. ? affects the part directly before it. In seo ?lab, what's optional is the space, not lab. Read it as: seo + an optional space + lab. If people type more than one space (seo lab), the current pattern won't cover it. But don't solve a problem before it exists: adjust when the data says you need to.

Building segments step by step

You have a site called Laptop House, with queries like: laptop house, laptophouse, laptop-house, laptop price, best laptop for coding, laptop house offers, lenovo vs dell, how much is lenovo, is lenovo good, buy lenovo. We want to make a few segments.

First: brand

We notice the variations: laptop house, laptophouse, laptop-house. We could write (laptop ?house|laptop-house). Notice laptop ?house covers laptop house and laptophouse at the same time.

Second: non-brand

We use the same pattern, but instead of Matches regex we use Doesn't match regex.

Third: questions

^(how|can|why|is|when|where|what). From our data, how much is lenovo and is lenovo good show up.

Fourth: comparison

(vs|versus|difference between| or ). From our data: lenovo vs dell.

Fifth: buying

(buy|order|finance|discount|deal|for sale). buy lenovo shows up. But laptop house offers might not, because we wrote "deal" and the user wrote offers. The pattern has to reflect the words your users actually type, not the ones you expect them to.

What's the most important step after you make a segment?

Review samples, not the numbers first. If you made a comparison segment, look at a set of the queries that showed up and ask: is this really the group I meant? If yes, then look at the metrics. If not, fix the pattern.

How to review any segment
  1. 1What showed up correctly? These are the results you wanted
  2. 2What showed up wrongly? These are false positives
  3. 3What should have shown up but didn't? These are false negatives
  4. 4What's the smallest change that fixes the problem? Change the part that caused it, don't tear down the whole regex

A false negative example: the price pattern (price|cost), and you find how much is a macbook isn't included: we add "how much". A false positive example: a comparison pattern, and you find "is shipping free or not" included. Then you decide whether " or " is really useful, or you drop it and accept losing some cases, or you analyze it separately. That's an analytical decision; there's no single right pattern for every site.

Note
The precision versus coverage mindset: a wide pattern catches most of the cases you want, but it also brings noise. A very narrow pattern gives precise results, but it can miss cases. If you're doing a first exploration, you can start wider. If you're building a precise numbers report for management, you need to review the segment more.

Don't compare unequal segments and jump to a conclusion. If you find a brand CTR of 28% and a non-brand CTR of 3%, don't say "the site is excellent at brand and bad at non-brand" before you look at average position, the amount of data, the types of pages and the time period. It's completely normal for brand queries to have a higher CTR: the person is already looking for you. Regex helped us pull out the group, but explaining the difference still needs SEO judgment.

And finally: you have a question segment, ^(how|can|why|is|when|where|what), and a long-tail segment of 7 words or more, ^\S+(\s+\S+){6,}$. They don't answer the same question: a query can be long and not a question, or a question and short. Don't treat them as the same segment.

Try it yourself

You have a brand called Digital Nest, and people type: digital nest, digitalnest, digital-nest, and the typo digitel nest. Write a brand regex that covers the four spellings.

  • digital nest
  • digitalnest
  • digital-nest
  • digitel nest
Try it yourself

Using the same pattern as above, how do you get non-brand?

  • digital nest
  • best laptop for work

The answer isn't a new regex: use Doesn't match regex instead of Matches regex, with exactly the same pattern.

Try it yourself

You have: how to choose hosting, is hosting important for seo, best web hosting, how much does hosting cost, hosting how to choose, why is my site slow. You want: the queries that start with how, is or why.

  • how to choose hosting
  • is hosting important for seo
  • best web hosting
  • how much does hosting cost
  • hosting how to choose
  • why is my site slow
Try it yourself

You have: wordpress vs shopify, wordpress versus shopify, difference between wordpress and shopify, wordpress or shopify, wordpress price, is wordpress free or not. Start with a comparison pattern, and see the problem that shows up when you use ' or '.

  • wordpress vs shopify
  • wordpress versus shopify
  • difference between wordpress and shopify
  • wordpress or shopify
  • wordpress price
  • is wordpress free or not

There's no single right answer here. What matters is explaining your decision: will you keep ' or ', drop it, or review its results separately?

The practical test

You have a site called Phone Hub, and people type the brand as: phone hub, phonehub, phone-hub, the typo fone hub, and phone hub offers.

Regex challenge

A brand regex for Phone Hub

Build a brand regex that covers every way users type the brand name, and leaves out every other query.

Must match
  • · phone hub
  • · phonehub
  • · phone-hub
  • · fone hub
  • · phone hub offers
Must not match
  • · iphone 17 price
  • · buy iphone 17
  • · how to choose an iphone

Once you've built the brand regex, the same pattern gives you non-brand with Doesn't match regex, and you can build separate question, comparison and price segments, each one answering a different question. Pick one of the segments you built, and write a real SEO question you'll use it to answer. Not "see the queries", but something like: do users who search for price land on product pages or on articles?

A real test of understanding

I don't want you to leave this lesson having memorized (price|cost|how much): anyone can copy and paste. I want you, when you walk into a new site with a different brand and a different language, to know: define the question → review the data → find the modifiers or the shared shape → build a first pattern → review the results → find what's missing and what got in by mistake → improve the segment → analyze the metrics.

Before the next lesson

So far we've handled messy spellings in a simple way. We wrote (phone ?hub|phone-hub|fone hub) and had to list each spelling separately. In the next lesson we focus entirely on that: how to handle the mess real queries bring. Spelling variants and typos, a space or a hyphen or nothing, capital and small letters, character classes, and why a short word like "pro" can match inside "product", and what \b does about it.

Well done, you reached the end of the lesson.