Can some one help me to extract the following text

I have the following line in a PDF file
TOTAL: 25,675 1,234,567

I need to extract the last value that is 1234567

Note there are spaces after TOTAL: and also after the first value

Can someone help me
Thanks

1 Like

Hi,

How about the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=TOTAL: [\d.,]+ )[\d.,]+").Value.Replace(",","")

Regards,

Thank u so much.
I will try this

HI @shilpa_p

Check out this expression

System.Text.RegularExpressions.Regex.Match("TOTAL: 25,675  1,234,567","(?<=TOTAL\W\s*[\d.,].*\s)\d.*").ToString.Replace(",","")

image

Regards
Gokul

1 Like

Thank u so much. I will try this as well

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