Hi,
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,
jack.chan
(Jack Chan)
2
@A_Learner
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
Yoichi
(Yoichi)
3
Hi,
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
Regards,
1 Like
Hello @A_Learner
Try this pattern:
(?<=Total other Charges Due By:\s\d+.\d+.\d+\s\$)[\d\.\,]+
Cheers
Steve
rlgandu
(Rajyalakshmi Gandu)
5
@A_Learner
(?<=Total other Charges Due By:\s+\d+/\d+/\d{4}\s+)$\d+.\d+
Vikas_M
(Vikas M)
6
Hey @A_Learner
You can try the below regex
($\d+,?\d+.?\d+)
So this will get all the digits present after the dollar sign
Hope this helps you out!
vrdabberu
(Varunraj Dabberu)
7
@A_Learner
Try the below regex expression
(?<=\d{4}\s+).?\d+\.?\d+
Or else if you wanted to remove the $ symbol then try this
(?<=\d{4}\s+.?)\d+\.?\d+
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
$\d+(?:.\d{2})?
Hope it helps!!
This solution worked for me. Thank you!
1 Like
Hi,
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,
Yoichi
(Yoichi)
13
Hi,
Can you share your project (xaml and data) if possible?
Regards,
Thank you! Some edit mistake. Working good.
system
(system)
Closed
15
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.