Back to list

How to use the condition "REGEX"?

The formula condition"REGEX" uses regular expressions for its work.
That is, it searches for values using regular expressions.

Let's use an example to show how it works and where you can use the condition"REGEX".

For example, we need to select products that contain the word "dress" in their name and assign them the name of the "woman" category.
The screenshot shows the file that will be used for import.



After that, go to the import settings and create a custom field that will use the condition "Regex".
When setting up the import, you need to go to the "Additional Settings" tab in the second step and create a custom field.



To create a Custom Field, you need to select the field that you want to use the regex condition. In our case, it will be product name.

We set the condition to "regex".
In the condition value, specify the process of using the regex formula.
Write down the name of the custom field "Category_regex".
For the formula type, select "String".
And then in the formula, we specify the category "Women" to which we want to link products that have the word "Dress" in their name.

Don't forget to save the created custom field!

Next, go to the "Associations" tab in the second step of the import.
And in the default category and associated categories select the new created custom field "Category_regex".



After that run the import.
The result of the "Regex" condition is shown below:



Products that had the word "Dress" in their names were associated with the women category.

Usefulness of the answer:
0/0
Having trouble with import?
Don't worry, we offer import assistance for you!
SURE, HELP ME!