A quick search for currency regex brings up a lot of results.
MSDN uses ^-?\d+(\.\d{2})?$
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.
So ... 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. ELEMENT DESCRIPTION ws Optional white space. sign An optional sign. digits A sequence of digits ranging from 0 to 9. , A culture-specific thousands separator symbol. . A culture-specific decimal point symbol. fractional-digits A sequence of digits ranging from 0 to 9.