Match Regex
Use the Match Regex activity to match string text against a specified regular expression.
If you are searching for a regular expression as a text string, the metacharacters must be escaped. For example, if the regular expression is abc:][}{:, the escaped text would be abc:\]\[\}\{\:.
You can use the output from the Escape Regex Metacharacters activity to provide the escaped search string.
You can manually enter the Regular Expression and Input String values or use a variable such as the output from other workflow activities, sub-workflows, or atomic actions that occur earlier in the workflow.
Usage
Complete the following properties to use this activity:
- Regular Expression - Enter the properties specific to the activity:
- Regular Expression - Specify a fixed string to represent the regular expression or click the Variable Reference icon to choose a variable.
- Match Case - Check this check box to specify whether regular expression matching should be case sensitive.
- Input String - Enter the input string for text to be parsed and matched against the specified regular expression or click the Variable Reference icon to choose a variable.
The output of this activity includes a True or False value in the Has Match field and each occurrence of the searched string will populate a new row in the Matching Strings table.
Examples
The following examples show the output of several combinations of properties:
-
The Regular Expression field is populated with the output from the Escape Regex Metacharacters activity:
-
The Match Case check box is unchecked (False):
-
The Match Case check box is checked (True):
With matching text:
With no text matches: