Find pattern transformations (based on regex)

Overview

DataBridge comes with a set of transformations that will help you to change, check or tweak the data in your source file or system. If you need to find a part of a (text) value or check it, you’ll find the Find Pattern transformation very useful. This transformation is based on regex (regular expressions).

More info on all the import transformations
More info on all the export transformations

Examples

Below are some examples to inspire you.

Get first up to 3 characters

^.{0,3}

Will get the first 0 to 3 characters

Get last up to 3 characters

.{0,3}$

 Wil get the last 0 to 3 characters

Get the first word

^[^\w]*(\w+)

Can include digits and _

Get the last word

(\w+)[^\w]*$

Can include digits and _

Get all characters up to ';'

([^;]+);

Will match test in ;test;

Get all characters after and including 'abc'

abc.*

 

Get the value that is between { and }

{(.+)}

Will match x}test{x in {x}test{x}

Get the first full number

[0-9]+

Will also match 123 in 123.456

Get the first decimal amount

[0-9]+\.[0-9]+ or [0-9]+,[0-9]+

Does not match full number

Get up to 3 characters from position 5

.{5}(.{0,3})

Will get the 0 to 3 characters after the first 5 characters. Does not retrieve anything if there are less than 5 characters.

Get exactly 7 characters between parentheses

\((.{7})\)

Will not return anything if there are not exactly 7 characters between the parentheses or if there are no parentheses.

A pattern of exactly 2 uppercase letters and exactly 5 digits between parentheses

\(([A-Z]{2}[0-9]{5})\)

Will not return anything if the pattern does not match between the parentheses or if there are no parentheses.

 

Please visit this page if you need some more detailed information about Regular Expressions (RegEx).

Note: We support two scenarios: (1) regex without any capturing groups and (2) regex with one capturing group
(1) Anything that match the pattern will be used as the value (my example before the last example)
(2) The value in the capturing group will be uased as the value (all other examples)