title: What is "The Best" U.S. Currency RegEx?
body: <p>A quick search for currency regex brings up <a href="https://regexlib.com/Search.aspx?k=currency&amp;c=-1&amp;m=-1&amp;ps=20" rel="noreferrer">a lot of results</a>.</p>
  <p>The problem I have in choosing one is that regex is difficult to verify without testing all the edge cases. Does anyone have a regex for U.S. currency that has been <em>thoroughly tested</em>?</p>
  <p>My only requirement is that the matched string is U.S. currency and parses to <code>System.Decimal</code>:</p>
  <pre>
  [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. 
  </pre>