What is the regex for 43 minutes and 100%..I only want the values i.e 43 and 100?

  1. Time it takes to refresh ePawsRpt from SQLPOS to Netezza: 43 minutes / 42.10 GB
  2. Number of store POS files processed for 06/05/2022: 2148 / 2132 (100.%)
  3. Netezza POS data available at: Jun 6 2022 5:39AM
  4. Org Chart data published and populated.

@aparna30 From the above data you need only 43 and 100 ?

Yes % will alwayz be in ()…it can be anything 99.2%

@aparna30

Time it takes to refresh ePawsRpt from SQLPOS to Netezza:
and
Number of store POS files processed for will always be same??

1st point will be same evrytime and for 2 nd point date will be changing i only the part which is in bracket for 2 nd point and for 1 st waterver the minutes are there i want that

Yes that will be same alwayz

  1. For 43 Try This
    (?<=SQLPOS to Netezza: )[0-9]+(?=\s)

2.For 100% Try This
(?<=()[0-9.%]+(?=))


if You don’t want . and % Sign Remove Just it from Expression.

Regards,
Saloni

@aparna30 To get the 43 you can use the below one. Also find below workflow for ref

Example.zip (3.1 KB)

System.Text.RegularExpressions.Regex.Match(Text, "(?<=Time it takes to refresh ePawsRpt from SQLPOS to Netezza:).*(?=minutes)").ToString

To get the 100 use below one

System.Text.RegularExpressions.Regex.Match(Text, "(?<=Number of store POS files processed for.*\()\d+").ToString

1 Like
(?<=Netezza: )(\d{1,})(?=(\s)minutes)

this will give any digits in between "Netezza: " and “minutes”

\((.*?)\%\)

this will give any characters between “(” and “%)”
Please use string trim from results
and if needed add try parse for decimal to have a check on the results

Decimal.TryParse(value, out number)

How can i get only the value …suppose if the value is 99.2% i only want 99.2?

the regex is going to give you the digits+decimal place

decAmount = if(Decimal.TryParse(strAmount , decAmount),CDec(strAmount),0)

the above code will check if the string fetched from regex(strAmount) is a decimal number or not , and try to convert it to a decimal number

use Regex.Matches or matches activity in uipath

Pattern for the minutes:


\d+(?= minutes)

Pattern for the percentage:


(?<=\()\d+(?=.%\))

1 Like