UiPath Invoke Code, Matches and Regex

Invoke code

Invoke code is a crucial activity as it allows us to integrate VB.Net code or C# code into a workflow. The Edit Code option opens the Code Editor. This activity is extremely powerful and used for complex automation projects and requires coding skills.


Matches activity is used to find targeted keywords, sentences, alphabets inside a string using Regex.

  • Clicking on Configure Regular Expression opens up the RegEx Builder. Inside the Test Text box, the user can check whether the Regex works for their required purpose.
  • In the given example, the given Regex pattern for email is able to identify the email address pattern within the supplied text and is highlighted with yellow.

  • The output is stored inside an Enum variable, which can be then converted to a string value as well. Inside the Input property, the targeted string is supplied followed by the Regex Pattern inside the Pattern box.
  • Inside the Result box, an Enum variable requires to be supplied in order to store the derived result.


Derived from the term REGular EXpression, is a series of characters that create to search pattern within the target string.

Regex has its syntaxes and is much different from traditional programming languages. UiPath has the full support of Regex patterns and has few inbuilt as well. The image shows highlight the Regex pattern for finding Emails inside a complex text. Similarly, Regex for URL, US date, US phone number are also included inside UiPath.

Innumerable Regex patterns are available all over the internet which can also be integrated into UiPath Match activity.