Is Text Matching
UiPath.Core.Activities.IsMatch
Description
Indicates whether the specified regular expression finds a match in the specified input string, using the specified matching options. This activity has a RegEx Builder wizard that can be used to configure it, on which you can read more here.
Project compatibility
Windows - Legacy | Windows | Cross-platform
Cross-platform configuration
- Text to search in - The string to be searched for matches.
- Pattern - The regular expression pattern to match.
Additional properties
- Pattern options - A bitwise combination of the enumeration values that specify options for matching.
- Result - A boolean variable that is set to true if the regular expression finds a match, and is set to false otherwise.
Windows - Legacy, Windows configuration
Designer panel
- Configure Regular Expression... - Opens the RegEx Builder wizard where you can specify the regular expression pattern to be matched.
Properties panel
Common
- DisplayName - The display name of the activity.
Input
- Pattern - The regular expression pattern to match.
- Pattern options - A bitwise combination of the enumeration values that specify options for matching.
- Text to search in - The string to be searched for matches.
- Timeout (ms) - The maximum duration, in milliseconds, that a pattern-matching operation can run before it is terminated. This property is essential for preventing the app from slowing down or freezing when processing complex or inefficient patterns. If the pattern match does not complete in the set time, an exception is thrown, ensuring the application remains responsive and safe from possible attacks that try to overload it.
important
We highly recommend setting a timeout value, to improve application stability and security.
Misc
- Private - If selected, the values of variables and arguments are no longer logged at Verbose level.
- Result - A boolean variable that is set to true if the regular expression finds a match, and is set to false otherwise.
Example of using the Is Text Match activity
This workflow explains how to verify the validity of an email address by using the Is Text Matching activity with a custom Regular Expression.
This is how the automation process can be built:
-
Open Studio and create a new Process.
-
Drag a Sequence container in the Workflow Designer.
-
Create the following variables:
Variable Name Variable Type Default Value EmailToCheckString John.Doe@server.orgIsMatchBoolean -
Drag an Is Text Matching activity inside the Sequence container.
-
In the Properties panel, add the variable
EmailToCheckin the Text to search in field. -
Add the variable
IsMatchin the Result field. -
Click the Configure Regular Expression button and customize your RegEx. For this example add the expression
^([\w\.-]+@[\w\.-]+\.\w{2,4})$in the Value field.noteMore information about how to customize and configure a Regular Expression can be found here.
-
Drag an If activity below the Is Text Matching activity.
-
Add the variable
IsMatchin the Condition field. -
Drag a Message Box activity inside the Then field of the If activity.
-
Add the expression
String.Format("{0} is a valid email address", EmailToCheck)in the Text field. -
Drag a Message Box activity inside the Else field of the If activity.
-
Add the expression
String.Format("{0} is not a valid email address!", EmailToCheck)in the Text field. -
Run the process. The email address added as input is verified and the result is displayed in a message box.