Skip to main content
Skip table of contents

Regex Match Table

The Regex Match Table tool is a hybrid tool combining aspects of the Table Lookup and Regex tools. It requires two inputs: a data input (labeled "D" on the tool icon), and a lookup table input (labeled "T" on the tool icon). The data input contains records with values that you want to match. The table input contains regular expressions/token pairs. Each line or record in the lookup table contains a regular expression followed by a token.

When the project is run, the Regex Match Table tool reads one record at a time from the "D" data input and attempts to match the record's Input field to the regular expression contained in the Pattern field. If a match is found, the corresponding token is output to the designated Token field. If no match is found, no token is appended to that record.

The Regex Match Table tool uses the Java regular expression engine rather than the Perl PCRE regex used by the Regex tool. See Comparison to Perl 5 for a list of syntax and usage differences between the two.

Regex Match Table configuration parameters

The Regex Match Table tool has one set of configuration parameters in addition to the standard execution options:

Input field

The field from the "D" data connection containing the text to be evaluated against the regular expression in Pattern field.

Pattern field

The field from the "T" table connection containing the regular expression.

Note that the Regex Match Table tool uses the Java regular expression engine rather than the Perl PCRE regex used by the Regex tool. See Comparison to Perl 5 for a list of syntax and usage differences between the two.

Token field

The field from the "T" table connection containing the match token to be appended to records that match Pattern field.

Certain options can be defined by including embedded flag expressions in the regex pattern. These include:

Option

Usage

Embedded flag expression

Case-insensitive matching

Enables case-insensitive matching. By default, case-insensitive matching assumes that only characters in the US-ASCII charset are being matched. Unicode-aware case-insensitive matching can be enabled by specifying the Unicode-aware case folding flag in conjunction with this flag.

(?i)

Multi-line matching

Enables multiline mode. In multiline mode, the expressions ^ and $ match just after or just before (respectively) a line terminator or the end of the input sequence. By default these expressions only match at the beginning and the end of the entire input sequence.

(?m)

Single-line parsing

Enables "dotall" mode ("single-line" mode in Perl.) In "dotall" mode, the expression . matches any character, including a line terminator. By default this expression does not match line terminators.

(?s)

UNIX lines

Enables UNIX lines mode. In this mode, only the '\n' line terminator is recognized in the behavior of ., ^, and $.

(?d)

Allow whitespace and comments in patterns

Permits whitespace and comments in pattern. In this mode, whitespace is ignored, and embedded comments starting with # are ignored until the end of a line.

(?x)

Unicode-aware case folding

Enables Unicode-aware case folding. When this flag is specified then case-insensitive matching, when enabled by the CASE_INSENSITIVE flag, is done in a manner consistent with the Unicode Standard. By default case-insensitive matching assumes that only characters in the US-ASCII charset are being matched.

(?u)

Unicode character classes

Enables the Unicode version of Predefined character classes and POSIX character classes. When this flag is specified, the (US-ASCII only) Predefined character classes and POSIX character classes are in conformance with Unicode Technical Standard #18: Unicode Regular Expression Annex C: Compatibility Properties.

The flag also enables Unicode-aware case folding.

(?U)

Configure the Regex Match Table tool

  1. Select the Regex Match Table tool, and then go to the Configuration tab on the Properties pane.

  2. Choose the Input field containing the text to be evaluated against the regular expression in Pattern field.

  3. Choose the Pattern field containing the regular expression. You may define matching and parsing options using embedded flag expressions.

  4. Choose an Token field containing the match token to be appended to records that match Pattern field.

  5. Optionally, go to the Execution tab, and then set Web service options.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.