Regex
The main goal of this type of rule is to extract some information. It's really powerful when you have a naming convention.
Like for other rules, you can put some conditions. And after this you must define:
- the source field: which metaproperty do you want to analyze?
- the regular expression: how to analyze the source field?
- the destination pattern: what do you want to extract?
- the destination field: where do you want to put your extracted information?
Let's take an example
In this example, we apply the rule if the asset:
- has a name
- is from the source "titelive"
As our naming convention is defined with:
- name begins with the sku
- name finishes with the position
We define a rule :
"/(?<sku>.^-*)-.*-(?<position>.*)/"
You can find more information or ways to test your regular expression for example on the website : regular expressions 101
We keep only the "sku" part and we put this dynamic value.
%%sku%%
If we don't put the "%%" before and after the code, it will be a static value. another example can be:
%%sku%%_%%position%%
Here we concatenate the "sku" and the "position" with an underscore.
In our example, the result of the pattern is sent to the "sku" metaproperty in Bynder.