Regex parenthesis

Hello, I have a question with regex, I have this text

Subtotal Transfer 117.00 VAT (21%) 24.57 T

how i catch 21?

Thanks

Hi @RPASOFT

Try this regex pattern

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

Consider the string in a variable let’s say input

To extract the number using the above regex pattern, use this

System.Text.RegularExpressions.Regex.Match(input,“(?<=()\d+(?=%)”).Value.ToString

Regards

Nived N :robot:

Happy Automation :relaxed::relaxed::relaxed:

@RPASOFT - Please give it try on the below Regex pattern…

(?<=\()[\d.,]+

Hope this helps…

1 Like

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