#FeatureBlog - 19.10 - Using regular expression (Regex) in the selector attributes

It is now possible to use Regular Expressions in your selectors. Follow this guide to learn how!

What’s new?

We have added extra syntax to the Selector Editor to allow for advanced configuration of your selectors.

Let’s begin

As an example, I will be creating a selector that will be able to open a file whose name is dynamically changing.

Let’s assume I am receiving daily list of bills via email which are saved as a text file named ‘bills mmddyy.txt’, e.g ‘’bills 101019’. Now, I want to write an automation that uses one single selector which will recognize the file name, no matter the receiving date.

  1. Assuming I have already downloaded the file on my computer, first I need to indicate the element I want to double click on to open it:

    image

    This results in the following selector:

    image

  2. Now, instead of the ‘text’ attribute absolute value, let’s use a regular expression that will match any string starting with ‘bills on’ and is followed by any numbers between 0 and 9. In addition, let’s instruct UiPath that the ‘text’ attribute is a regular expression and needs to be matched consequently, by adding the syntax:

    matching:text='regex'
    

    Like so:

  3. When we press the Validate button, the selector should be valid and the button should turn to green:

  4. When pressing the Highlight button, the correct element is going to be highlighted on the screen:

    image

  5. Now, let’s change the file name on disk to ‘bills on 101119’:

    image

  6. Going back to the Selector Editor window, and using the same selector using Regex, let’s press the ‘Validate’ button. The selector is also valid for the new file name and the Validate button remains green:

  7. Pushing ‘Highlight’ button, it will highlight the new file name on the disk:

    image

And this is how you tune your selectors to use regular expressions! The option can be used for almost any attribute, except that ones identifying the application executables like app=‘explorer.exe’ or app=’chrome.exe’

Also, it can be used for many attributes at the same time in same selector and, at any selector level you want!

That’s it for this #FeatureBlog

Please provide your valuable feedback about this feature! Our product team is hungry to build upon the basic functionalities so feed them your ideas :slight_smile:

Don’t be shy, click on image and tell us what you think or do it directly from Studio image !
As always, thank you for reading and happy automating!

13 Likes

Wow its really awesome:heart_eyes:

2 Likes

Great feature.

1 Like

Wow! nice informative info. @loginerror

cheers

3 Likes

The fact of making selectors more flexible is really helpful, I was waiting on this one!
Thanks :smiley:

1 Like

Very nice feature… :smile:

So much new features that I cannot follow them all trough :smiley: