---
title: Extract Regex
description: Extract Regex
---

[Skip to content](https://support.dotidot.io/en/hc/en-us/articles/360017852952-extract-regex#main-content)

[![Logo\_dark](https://support.dotidot.io/hs-fs/hubfs/Logo_dark.png?width=150&height=35&name=Logo_dark.png)](https://www.dotidot.io/)

- [Home](https://www.dotidot.io/)
- [Webinars](https://www.dotidot.io/webinars)
- [Pricing](https://www.dotidot.io/pricing)
- [Blog](https://www.dotidot.io/blog)
- [Company](https://www.dotidot.io/about)

Open main navigation

Close main navigation

- [Home](https://www.dotidot.io/)
- [Webinars](https://www.dotidot.io/webinars)
- [Pricing](https://www.dotidot.io/pricing)
- [Blog](https://www.dotidot.io/blog)
- [Company](https://www.dotidot.io/about)
- [Contact us](https://www.dotidot.io/contact)

[Contact us](https://www.dotidot.io/contact)

 How can we help you?

- There are no suggestions because the search field is empty.

1. [Dotidot knowledge base](https://support.dotidot.io/en?hsLang=en)
2. [Campaigns](https://support.dotidot.io/en/campaigns?hsLang=en)
3. [Keywords](https://support.dotidot.io/en/campaigns?hsLang=en#keywords)

# Extract Regex

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})\\b****”* and 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:

**1.)** name of the shoe, no color or size

**2.)** name of the shoe + color

**3.)** name of the shoe + size

**4.)** 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 Expression*function, 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 Regex*function: ***\\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 Regex*function to extract all — ***\\d+*** figures.

- [Getting started with Dotidot](https://support.dotidot.io/en/getting-started-with-dotidot?hsLang=en)
- [Data Sources](https://support.dotidot.io/en/data-sources?hsLang=en#main-content)

    - [Data sources types](https://support.dotidot.io/en/data-sources?hsLang=en#data-sources-types)
    - [Variables](https://support.dotidot.io/en/data-sources?hsLang=en#variables)
    - [Data enrichment](https://support.dotidot.io/en/data-sources?hsLang=en#data-enrichment)
    - [Feed exports](https://support.dotidot.io/en/data-sources?hsLang=en#feed-exports)
- [Campaigns](https://support.dotidot.io/en/campaigns?hsLang=en#main-content)

    - [DSA campaigns](https://support.dotidot.io/en/campaigns?hsLang=en#dsa-campaigns)
    - [Assets](https://support.dotidot.io/en/campaigns?hsLang=en#assets)
    - [Meta campaigns](https://support.dotidot.io/en/campaigns?hsLang=en#meta-campaigns)
    - [Keywords](https://support.dotidot.io/en/campaigns?hsLang=en#keywords)
- [Product Analytics](https://support.dotidot.io/en/product-analytics?hsLang=en)
- [Image Editor](https://support.dotidot.io/en/image-editor?hsLang=en)
- [Pricing and billing](https://support.dotidot.io/en/pricing-and-billing?hsLang=en)
- [Tips for using the app](https://support.dotidot.io/en/tips-for-using-the-app?hsLang=en)
- [FAQ](https://support.dotidot.io/en/faq?hsLang=en)

- [Home](https://www.dotidot.io/)
- [Webinars](https://www.dotidot.io/webinars)
- [Pricing](https://www.dotidot.io/pricing)
- [Blog](https://www.dotidot.io/blog)
- [Company](https://www.dotidot.io/about)

# Dotidot

<https://www.facebook.com/dotidot.official> <https://www.instagram.com/dotidot_official> [mailto:info@dotidot.io](mailto:info@dotidot.io)

Copyright © 2026, Dotidot