What is “The Best” U.S. Currency RegEx?
A quick search for currency regex brings up a lot of results . The problem I have in choosing one of these is that regex is difficult to verify without testing all the edge cases. I could spend a lot of time on this as I am sure hundreds of other developers have already done. Does anyone have a regex for U.S. Currency that has been thoroughly tested ? My only requirement is that the matched string is U.S Currency and parses to System.Decimal : [ws][sign][digits,]digits[.fractional-digits][ws] Elements in square brackets ([ and ]) are optional. The following table describes each element.