I am trying to find the currency in strings like "NTE $22,539,420.00"
I tried to use several regular expressions including ^\s*[\+-]?\s?\$?\s?(\d*\.?\d{2}?){1}$ but none of them seem to work. Does anyone have any suggestions or reasons why the above would not work.
Thanks, Jim
Could you just dump all the formatting (except for the decimal) like so?
string money = "NTE $22,539,420.00";
string scrubbed = Regex.Replace(money, @"[^0-9\.]", string.Empty);
At this point, scrubbed contains 22539420.00.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With