Match RegEx Condition
The condition Match Regex checks the input value for a specific field for a pattern, defined as Regex e.g. Check if the input is a valid email address or product code and otherwise remove access until this information is correct. This condition also applies the Regex to the value in the provided fieldpath and allows to either validate the value (regex validation) or to generate an output. Extract the Product Code from the filename and use it in the following transformations to e.g. apply tags for product attributes.
This is especially useful when you have a media standard in place and all files follow naming rule conventions e.g. every file is named with product-code_project-name_department_date.
Triggers if the Regular Expression is true.
Specific Definitions
Select the condition.
Property | Value |
kind | MatchRegexCondition |
fieldpath | layerId.fieldId Details on accessing field values, specifically fieldpath starts lowercase Supports JSON path syntax which you can test here: https://jsonpath.com. |
regex | Provide the regular expression that should be applied to the value in the provided fieldpath. |
storeIn | Define an optional variable where the regex output should be stored, to use in the following transformations and actions. Provide any name you like, avoid numbers at the beginning. You can leave this field empty. If you don't define it the output value will just be passed to the next transformation. |
Check Filename of Images for Regex
Get Product Code and Store in "parsed_filename" variable
{
"kind": "MatchRegexCondition",
"fieldPath": "imageMetadata.fileName",
"regex": "(?<productCode>^(F-|G-|V-)[^_]*?)_()",
"storeIn": "parsed_filename"
}