How to extract price value from this text

Hi,

TextVal=“Service Request is closed. RAMSAY HEALTH CARE AUSTRALIA PTY LTD will be billed AUD 25.(SBL-BPR-00131)”

I want to extract value after “AUD” before “.(”

output value should be “25”

Please Suggest me if you have any solution

Thanks
likitha

You can use the Substring() Method to get the value of your expected text

Hi,

Can you please elaborate

Hey @vinjam_likitha,

You can use regularexpressions to get that value.

System.Text.RegularExpressions.Regex.Match(TextVal,"AUD\s+\d+")

Thanks,
Sanjit

Like this given picture

Hi,

Can you try the following expression?

System.Text.RegularExpressions.Regex.Match(TextVal,"(?<=AUD\s*)\d+(?=\.\()").Value

]

Regards,

Hello @vinjam_likitha ,

System.Text.RegularExpressions.Regex.Match(TextVal,“(?<=AUD)\s+\d+”)

Regards,
Rohith

Hello @vinjam_likitha
Try Regex method

System.Text.RegularExpressions.Regex.Match(YourString,"(?<=AUD).*(?=\()").ToString.Trim

If need as integer variable try this

Cint(System.Text.RegularExpressions.Regex.Match(YourString,"(?<=AUD).*(?=\()").ToString.Trim)

image

image

Hi All,

Thank you for the solutions

Thanks
Likitha

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