Get last value with regex

Hi,
How can I get “1.717,67” in below text with regex.

Total Euros

1.577,29 1.577,29 1,00 15,77 1.561,52 10,00 156,15 1.717,67

HOTEL&SPA…

1 Like

U can use this expression

System.Text.RegularExpression.Regex.Match(“your input”, “[\S]+(\d)$”).ToString

Cheers @murat.karasoy

Hi @murat.karasoy

How about this expression?

System.Text.RegulseExpression.Regex.Match(“YourInput”, “(?=\S)[\d.,]+$”).ToString

Regards
Gokul

Hi @murat.karasoy

You can use the data manipulation to extract the output data.

- Assign -> InputStr = "1.577,29 1.577,29 1,00 15,77 1.561,52 10,00 156,15 1.717,67"
- Assign -> Output = InputStr.Split(" ").Last

Check the below regular expression to extract the output data.

System.Text.RegularExpressions.Regex.Match(yourstringinput.ToString,“((?<=\s+)[\d.,]+$)”).value

Hope it helps!!

text in continue. 1.717,67 in only line break.

yeah even if any line comes next it will be able to get that last numerical value, the one u want

@murat.karasoy

In the options in the regex tester check the multiline option and try. It will work for sure @murat.karasoy

fine, can u share the complete text if possible @murat.karasoy

Subtotal Base Dto.Com. % Dto. Dto. Comercial Base Imponible % IVA Cuota Total Euros

1.577,29 1.577,29 1,00 15,77 1.561,52 10,00 156,15 1.717,67

HOTEL&SPA

INFORMACION BASICA SOBRE PROTECCION DE DATOS RESPONSABLE DEL TRATAMIENTO

It’s working for me @murat.karasoy

Use the regexr website.

Hope you understand!!

Hi @murat.karasoy

have you tried with this one?

Regards
Gokul

It works in https://regexr.com/ but not in UiPath.
Best website .NET Regex Tester - Regex Storm for UiPath

(?<=Total Euros\s+.+)[\d.,]+(?=\s+[a-zA-Z])

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.