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:
-
Open the action in the configuration panel. For more information, see Add an action to the workflow.
- Drag the Apply a regular expression action to where in the workflow you want to perform an operation on a string of text.
- Click the Apply a regular expression action.
- Type the Input text.
- Select an Operation.
- If you selected the Replace Operation, type Replacement text.
- Type a regular expression Pattern.
-
Click Check Expression to quickly validate your JSONPath expressions in Nintex Platform API. This reduces the need to execute the workflow to validate expressions.
- Select an option for Ignore case.
- Select a variable to Store first result in.
- Select a variable to Store results in.
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}.
![Closed](../../../Skins/Default/Stylesheets/Images/transparent.gif)
Field |
Description |
Variable |
---|---|---|
Check Expression |
Click to go to Nintex API developer platform where you can directly check and validate your expressions directly. The authorization token is automatically generated for you when Nintex API developer platform is launched. |
n/a |
Input text | The text string that the action performs the operation on. | Text, Decimal, Integer, Boolean, DateTime, Collection |
Operation |
The type of operation used in conjunction with the Pattern on the Input text. Select:
|
(n/a) |
Pattern |
A sequence of characters that define a search on the Input text. The pattern is used to perform an Operation on the Input text. The Patterns follows .Net syntax. For more information, read about .NET regular expression pattern syntax and operations. |
Text, Decimal, Integer, Boolean, DateTime, Collection |
Ignore case |
Select whether or not to ignore case during the operation. For example, a Check match Operation with the Input text of "apple" with the Pattern of "Apple" finds a match if Yes is selected for Ignore case. |
Boolean |
Replacement text |
Displays when the Replace Operation is selected. The text which replaces the Input text defined in the Pattern. |
Text, Collection |
Store first result in |
The variable which stores the first result for the selected Operation. |
Check match: Boolean Split: Text, Decimal, Integer, Boolean, DateTime Extract: Text, Decimal, Integer, Boolean, DateTime Group: Text Replace: Text, Decimal, Integer, Boolean, DateTime |
Store results in |
The variable which stores the results for the selected Operation. The variable type depends on the selected operation. See the variable column. |
Check match: Boolean Split: Text, Collection Extract: Text, Collection Group: Text, Collection Replace: Text, Collection |