Regex fix

I am trying to match the amount in the following sentence

Total other Charges Due By: 2/15/2023 $4412.63

with the Regex
(?<=Total other Charges Due By:/d+//d+//d+/s+)(\s+$\d+,?\d+.?\d+)

It is not working. Not getting the amount. Can you help please ? Thank you,

change to this

Total other Charges Due By: [\d]{1,2}\/[\d]{1,2}\/[\d]{4} (\$\d+,?\d+.?\d+)

get the value like this

System.text.regularExpressions.Regex.match(input, "Total other Charges Due By: [\d]{1,2}\/[\d]{1,2}\/[\d]{4} (\$\d+,?\d+.?\d+)").Groups(1).value


How about the following expression?

System.Text.RegularExpressions.Regex.Match(yourString,"(?<=Total other Charges Due By:\s*\d{1,2}/\d{1,2}/\d{4}\s+)\$[\d.,]+").Value


1 Like

Hello @A_Learner

Try this pattern:
(?<=Total other Charges Due By:\s\d+.\d+.\d+\s\$)[\d\.\,]+




(?<=Total other Charges Due By:\s+\d+/\d+/\d{4}\s+)$\d+.\d+

Hey @A_Learner

You can try the below regex


So this will get all the digits present after the dollar sign

Hope this helps you out!


Try the below regex expression


Or else if you wanted to remove the $ symbol then try this


The below is the changed syntax of your regex expression

(?<=Total other Charges Due By:\s+\d+\/\d+\/\d+\s+)(.?\d+.?\d+)

Hope it works!!

Hi @A_Learner

Hope it helps!!

Hi @A_Learner

Try this



I hope it helps!!

This solution worked for me. Thank you!

1 Like

Regex in .NET Regex Tester - Regex Storm works. But when I use it in code using Match(), it returns nothing. I am not sure why?

Thank you,


Can you share your project (xaml and data) if possible?


Thank you! Some edit mistake. Working good.

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