4 mins read

Try out regular expressions, this time in reverse

0 1*8x0xzilj3tuinkhefyz nw0 1*8x0xzilj3tuinkhefyz nw
Sometimes, thinking up keywords can be a pretty tough nut to crack, all the more if your data feed isn’t exactly tidy; for example, if the source’s product_name contains a lot of details which won’t be used in keywords because they are either too general, or too specific.
This can be resolved by modifying the variable, i.e. by creating a couple of your own, new variables and using regular expressions to remove groups of words or characters from them, until only the required word is left.

But maybe you have thought at one point or another that it would be nice if this lengthy process could be simplified. What if you could just extract a group of words from the text instead of removing it? Simply put, make the functionality be completely opposite to the traditional regular expression? And if you haven’t wondered that, then you no longer need to because we’ve created a new function for you which works precisely this way — Extract regex!

We’ll show you how it works in practice, using three different examples — electronics, fashion, and anything that falls outside these two categories.

In case of electronics, _brand_ + _model_number_ is a good keyword. Let’s say that Lenovo Legion Y520–15IKB, black, is our initial text, meaning that we want to post an ad for Lenovo Y520–15IKB. Using our own variable, we formulate a regular expression “A mix of letters and digits (in most cases): \b((?=[A-Za-z-\/]{0,19}\d)[A-Za-z0–9\/-]{4,20})\band choose the Extract regex function.

In case of clothes and shoes, it definitely pays off to have more variations. So, our initial text goes like Vans UltraRange 3D — Black/Asphalt 47, and we’d like to create these four variations:

name of the shoe, no color or size

name of the shoe + color

name of the shoe + size

name of the shoe + size + color

The number 1.) option can be created the same way you’re already used to — with a template of regular expressions, by removing color and quality. This gives you Vans UltraRange 3D.

In case of option number 2.), you have to create your own text variable for colors to go along with the shoe’s name. From the Find Regular Expressionfunction, select “Colors in English:\b(black|white|grey|gray|red|green|blue|silver|gold|brown|yellow|orange|pink|purple)\b. You end up with Vans UltraRange 3D Black.

Option number 3.) can be created in the same way — With the Extract Regexfunction: \b(35|36|37|38|39|40|41|42|43|44|45|46|47|48|L|XXS|XS|S|XL|M|XXL|XXXL)\b. We arrive at Vans UltraRange 3D 47.

The last option, number 4.), is created by simply adding your own text variable _color_ + _size_ to the shoe’s name. The final keyword is Vans UltraRange 3D 47 Black.

Let’s demonstrate the last example with a building set. The initial text goes LEGO Batman Movie 70905 Batmobil. You’d like to post an ad for it, using the keyword _brand_ + _set_number_, in this case LEGO 70905. Such a keyword can be extracted with your own text variable. Use the Extract Regexfunction to extract all — \d+ figures.

All you need to do after that is contact us at and show off how much time this new function saved you! If anything at all is unclear to you, don’t hesitate to contact us.

Related articles

Read more

Data feed as a basis for product campaigns

Do you need to create PPC campaigns for searches that involve a large number of product or service variations? You can with PPC Bee — but you need to have a data feed at the ready. You’re in luck as data feeds are the subject of this article. We often encounter clients who’d like to use PPC Bee but don’t have any such data feed or aren’t even aware what it even is.

By Michaela ZákopčaníkováSep 3, 2018 | 4 mins read

Read more

A little throwback to 2018

How many lines of source code does PPC Bee consist of? How many new partners have joined our team? And how many pounds of honey have made the day of our clients and others?

By Michaela ZákopčaníkováJun 5, 2019 | 1 min read

Read more

Tech Crunch Disrupt - Day 2

Mornings are always hard after an amazing networking party sponsored by Cheetah Mobile. We talked to a few very interesting people. We are tired so we are focusing on other startups and their work. Startups are working hard to attract attention of every single soul passing by. We have put together some photos for you, so that you can enjoy TCD atmosphere as well:

By PPC BeeSep 25, 2015 | 6 mins read