Apply a regular expression

Use the Apply a regular expression action A tool for building the processes, logic, and direction within workflows. to perform a check, match, split, extract, or replace operation on text using a regular expression pattern.

For example, you can use the Apply a regular expression action when working with a list of semi-colon-delimited postcodes retrieved from an accounting system and you want to split each of the values separated by semi-colons. Configure the action to split a Text value of semi-colon delimited postcodes and store the results in a new Collection variable. The regular expression changes a Text value of 3000;3005;3011;3015;3041 to a Collection of ["3000", "3005", "3011", "3015", "3041"].

The Apply a regular expression action patterns follow .NET syntax. For more information, read about .NET regular expression pattern syntax and operations.

Configure the Apply a regular expression action

In the Designer page:

  1. Open the action in the configuration panel. For more information, see Add, rename, and copy actions.

  2. Drag the Apply a regular expression action to where in the workflow you want to perform an operation on a string of text.
  3. Click the Apply a regular expression action.
  4. Type the Input text.
  5. Select an Operation.
  6. If you selected the Replace Operation, type Replacement text.
  7. Type a regular expression Pattern.
  8. Note: To input a number (for example, {2}), you must instead type {2,2}. The Apply a regular expression action does not use a schema transformer and cannot process {number}.

  9. Click Check Expression to quickly validate your JSONPath expressions in Nintex Platform API. This reduces the need to execute the workflow to validate expressions.

  10. Select an option for Ignore case.
  11. Select a variable to Store first result in.
  12. Select a variable to Store results in.