Skip to main content

Match

AutomatR.DefaultActivities.GenericValue.Match

The "Match" activity in AutomatR, categorized under String, searches an input string for all instances of a regular expression and retrieves all successful matches. This activity is useful when you need to extract specific patterns from a string based on a regular expression.

Properties

NameDescription
Input
InputThe string to be searched for matches. String variables containing the input string.
PatternThe matching regular expression pattern. String variables containing the regex pattern.
RegexOptionsSelect a bitwise combination of the enumeration values that specify options for matching from the dropdown.
Misc
Display NameProvides 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
DelaySpecifies the amount of time (in seconds) to wait before executing the "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
ResultIt stores the result with a match variable, which can be used in other subsequent activities. Variables of type System.Text.RegularExpressions.Match to store the match result.

How to use:

  1. Drag and drop the "Match" activity onto the workflow.
  2. Configure the properties by specifying the input string, regex pattern, and regex options.
  3. Optionally, configure the delay based on your requirements.
  4. Execute the workflow to search for matches in the input string based on the specified regex pattern.

Example: Consider an example where the "Match" activity is used to extract the domain from an email address:

Match:
Input: "user@example.com"
Pattern: "@([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})"
RegexOptions: IgnoreCase
Result: extractedDomain

In this example, the activity searches for the domain pattern within the input email address "user@example.com". The result, which includes the matched domain, is stored in the System.Text.RegularExpressions.Match variable "extractedDomain" for further handling in the workflow.