Get a single value from a sentence

Hello, im developing a robot that inputs values on an application. In this application i register “Customers” and after i finish the registration i get the following message “Verification to use TEST1833 as the customer code”. That customer code is for testing purposes, on a real scenario that code will be based on the customers name and a random number i want to get “TEST1833” (the customer code) and save it on a variable since i will be using the customer code later. How could i achieve this? Thanks in advance

Hello @Raul_Cruz - welcome back to the forums

Tell us more about the value of “TEST1833”.

You need to get the text into UiPath (screen scraping or “get text” activity).

Then use a Matches Activity with the Regex pattern “\b\w+\d+\b” - preview the result here.

Then use an assign activty with the Matches output like this.

Code = MATCHESRESULT(0).tostring

Update the capital letters.

Hopefully this helps :slight_smile:

Cheers

Steve

1 Like

Thank You very much! I got the correct result. I didn’t quite understand how the Matches activity with the Regex pattern works. Do you have a link or a video where this is explained with more details?

Oh great - glad I could help :blush:

A matches collection is an ‘ienumerable’ variable which is a collection of results.

Check out my Regex Megapost to learn more…

The YouTube channel “Anders Jensen” Is a great place to start also.

Cheers

Steve

1 Like