Regex Evaluation

    You can use this transform to parse a complex string of text and create new fields out of the input field with capture groups (defined by parentheses). For example, if you have an input field containing an author’s name in quotes and the number of posts made by them, you can create two new fields in your pipeline - one for the name, and one for the number of posts as shown below:

    Text to parse:

    Regex to create two capture groups:

    The resulting field values are: Ann and 53.

    The Settings tab contains the following options:

    You can test your regular expression against three different input strings using the following Regular expression evaluation window. If your expression contains a group field, type a string in the Compare section and the option below the string will be split according to your group(s).

    The Content tab contains the following options:

    Suppose your input field contains a text value like “Author, Ann” - 53 posts. The following regular expression creates four capturing groups and can be used to parse out the different parts:

    This expression creates the following four capturing groups, which become output fields:

    • Fullname: [“]), ([“]

    • Lastname: ([^”]+)

    • Firstname: ([^”]+)

    • Number of posts: (\d+)

    If the number of capture groups in the regular expression does not match the number of fields specified, the transform will fail and an error is written to the log. Capturing groups can be nested. In the example above the fields Lastname and Firstname correspond to the capturing groups that are themselves contained inside the Fullname capturing group.