Activities
latest
false
Banner background image
Workflow Activities
Last updated Feb 23, 2024

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

  • Input: - The string to be searched for matches.
  • Pattern - The regular expression pattern to match.
Advanced options

Others

  • Regex Option - A bitwise combination of the enumeration values that specify options for matching. The available options are IgnoreCase, Multiline, ExplicitCapture, Compiled, Singeline, IgnorePatternWhitespace, RightToLeft, ECMAScript, and CultureInvariant.
  • 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
  • Input: - The string to be searched for matches.
  • Pattern - The regular expression pattern to match.
  • RegexOption - A bitwise combination of the enumeration values that specify options for matching.
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 Match activity

This workflow explains how to verify the validity of an email address by using the Is Match activity with a custom Regular Expression.

This is how the automation process can be built:

  1. Open Studio and create a new Process.
  2. Drag a Sequence container in the Workflow Designer.

    • Create the following variables:

      Variable Name

      Variable Type

      Default Value

      EmailToCheck

      String

      John.Doe@server.org

      IsMatch

      Boolean

       
  3. Drag an Is Match activity inside the Sequence container.

    • In the Properties panel, add the variable EmailToCheck in the Input: field.
    • Add the variable IsMatch in 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.
      Note: More information about how to customize and configure a Regular Expression can be found here.
  4. Drag an If activity below the Is Match activity.

    • Add the variable IsMatch in the Condition field.
  5. Drag a Message Box activity inside the Then field of the If activity.

    • Add the expression String.Format("{0} is a valid email addess", EmailToCheck) in the Text field.
  6. Drag a Message Box activity inside the Else field of the If activity.

    • Add the expression String.Format("{0} is not a valid email addess!", EmailToCheck) in the Text field.
    • This is how your workflow should look:



  7. Run the process. The email address added as input is verified and the result is displayed in a message box.

Was this page helpful?

Get The Help You Need
Learning RPA - Automation Courses
UiPath Community Forum
Uipath Logo White
Trust and Security
© 2005-2024 UiPath. All rights reserved.