Is Match
AutomatR.DefaultActivities.GenericValue.IsMatch
The "Is Match" activity in AutomatR, categorized under String, checks whether a specified regex pattern finds a match in the specified input string using the provided Regex Options. This activity is beneficial for scenarios where you need to validate whether a given pattern exists in a particular string.
Properties
Name | Description |
---|---|
Input | |
Input | The string to search for a match. String variables containing the input string. |
Pattern | The matching regular expression pattern. String variables containing the regex pattern. |
RegexOptions | Select a bitwise combination of the enumeration values that specify options for matching from the dropdown. |
Misc | |
Display Name | Provides a customizable name for the activity displayed in the workflow. The display name enhances clarity and organization within the automation project. String variable or argument containing the desired display name. |
Optional | |
Delay | Specifies the amount of time (in seconds) to wait before executing the "Is Match" activity. Useful for handling synchronization issues. Integer variables containing the delay duration. Example: If the wait time is 1000 milliseconds or 1 sec, i.e., 1. |
Output | |
Result | Returns the result as true or false based on the success of the operation execution. Boolean variables to store the operation result. |
How to use:
- Drag and drop the "Is Match" activity onto the workflow.
- Configure the properties by specifying the input string, regex pattern, and regex options.
- Optionally, configure the delay based on your requirements.
- Execute the workflow to determine if the specified pattern is found in the input string.
Example: Consider an example where the "Is Match" activity is used to check if a string contains a valid email address:
Is Match:
Input: "user@example.com"
Pattern: "[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}"
RegexOptions: IgnoreCase
Result: isEmailValid
In this example, the activity checks if the input string "user@example.com" matches the specified email pattern. The result of the operation (true or false) is stored in the Boolean variable "isEmailValid" for further handling in the workflow.