This activity helps you validate details using the format of a data/detail.
Technical Reference
INPUT |
InputString: Enter the input string to which the Regex pattern has to be applied. |
|
Pattern: Enter the Regex pattern to be used. |
||
RegexOption: Choose from the drop-down menu |
||
MISC |
Display Name: Displays the name of the activity. You can also customize the activity name to help troubleshoot issues faster. This name will be used for logging purposes. |
|
SkipOnError: It specifies whether to continue executing the workflow even if it throws an error. This supports only Boolean value “True or False” True: Continues to execute the workflow irrespective of any error thrown. False: Stops the workflow if it throws any error |
||
Version: It specifies the version of the Regex Automation feature in use. |
||
OUTPUT |
Result: Declare a variable here to view the result. This is not a mandatory field however declare a variable to get the result. |
* Mandatory fields to execute the workflow.
Use Case
The following steps illustrates how we use the IsMatch feature to validate the input string
with the regex pattern. Here we give a regex pattern and an input string. This activity shows if
the given regex pattern matches to the input string.
Steps to execute the bot
1. Drag and drop an IsMatch activity from the Regex feature.
2. Click on the activity and enter the variable which was declared with the input string in
the variable section. Here it is Text.
3. Enter the Regex pattern to be validated. Here we are going to validate the email ID
"(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|""(?:[\x01-\x08\
x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*"")@(?:(?:
[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:25[0-5]|2[0-4][0-9]
|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\x01-\
x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])"
4. Choose the Regex option to be applied to the input string.
5. Declare a variable in the result box for which the result has to viewed. Here the result
is a Boolean value.
6. Drag and drop a write log activity below the IsMatch activity.
7. Click on the activity and enter the input as Match.ToString as the write log accepts
only string values.
8. Specify the log level as” info”.
9. Execute the activity.
The bot executes the activity and gives the result as true, which means that the
input string matches with the regex pattern.