Using Regex with UiPath

Hi,

I’ve created some regex commands using the Regex101.com website but UiPath doesn’t recognise certain aspects (eg. [[:graph:]] ). The flavour selected on Regex101 was PHP. Do I need to select a different flavour which is compatible with UiPath, if so, what is the best selection please?

Thanks.

Hi @TRX,

Select PCRE engine

Hi, I already had PCRE selected but UI Path doesn’t seem to recognise some of the expressions. Is there an additional library/pack that needs downloading in UiPath?

What is the expression you are using?

What is the respective string

Hi,

An example is: Type: ([[:print:]]+)\nLocation

Hi @TRX,

Have you escaped the characters and tried like this ([[:print:]]+)\nLocation

And if possible can you provide your string and value you are extracting form it.

Thanks anil5,

An example of the text extracting data from is below:

Type: 12345
Location

I am trying to extract value “12345”

When you say “escaped” the characters, what do you mean please?

Thanks,

Hi @TRX,

You can use below pattern
\d+

Or

(?<=Type:).*(?=Location)

Regards,
Arivu

Hi @TRX,

If your input is like below and if you want to extract 12345 then use the below expression

Type: 12345
Location

(?<=Type: ).+?(?=\nLocation)

Try out here https://regex101.com/r/Nr3Kyw/2