UiPath Activities Guide

RegEx Builder Wizard

The RegEx Builder wizard is created to ease your process of building and testing Regular Expression search criteria. It contains a text editor, called Test Text, in which you can test the search criteria you choose against the text that you want to apply RegEx on. Below the text editor you can choose the Type, Value, and Quantifiers of the RegEx expressions you want to match the text to. Doing so highlights the findings in the Test Text editor. The Full Expression text box in the bottom of the wizard displays the current RegEx expression in its raw form.

Note:

The RegEx flavor used by the RegEx Builder wizard is the official .NET Framework Regular Expressions one, on which you can read more here.

Using the RegEx Builder Wizard

The RegEx Builder wizard can be opened from the body of any of the three activities IsMatch, Matches, and Replace, by clicking the Configure Regular Expression button. This wizard helps you build the regular expressions you want to use for any of the three activities.

The Test Text input box enables you to highlight the results of running the current regular expressions you have configured against the text you want to use. We recommend using the Test Text input box of the RegEx Builder with the actual content you are going to work with.

The RegEx drop-down menu lets you choose between the many kinds of pre-generated RegEx expressions. The available options are:

  • Literal
  • Digit
  • One of
  • Not one of
  • Anything
  • Any word character
  • Whitespace
  • Starts with
  • Ends with
  • Advanced
  • Email
  • URL
  • US date
  • US phone number

Hovering over the info button displays additional information on the corresponding preset, what it can be used for, and provides a short example.

The Value field enables you to type what you are looking for in the text. For example, if the Literal preset is selected, you can write a word you want to find in the text and it becomes highlighted in the Test Test field.

The Quantifiers drop-down menu enables you to select how many results you want to find for the searched term. There are multiple options for each possibility, and the input field next to this drop-down menu changes to accommodate each of them:

  • Exactly - You may select an exact amount of consecutive occurrences you want to find. For example, if the text you are searching for is lorem and the Quantifiers is set to Exactly 2, the wizard finds any occurrences of loremlorem in the Text Test box.
  • Any (0 or more) - This highlights any number of consecutive found matches, starting from 0.
  • At least one (1 or more) - Highlights any number of consecutive found matches, starting from 1.
  • Zero or one - Only highlights a single consecutive occurrence of the term.
  • Between X and Y times - Highlights the amount of consecutive occurrences you select. For example, searching for ipsum and selecting Between 2 and 3 times only highlights ipsumipsum and ipsumipsumipsum.

Using the add button, you can easily add multiple RegEx configurations. Then, by using up and down you can reorder the conditions or remove them by using remove.

The Full Expression field displays the current form of the regular expression you have built, and gets updated every time you change something in the conditions. You can also further customize the RegEx by using the IgnoreCase check box, which is selected by default, and ignores uppercase or lowercase letters.

Clicking Save closes the wizard and configures the activity, which is now ready to be used.


RegEx Builder Wizard


Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.