title: Validate currency amount using regular expressions in JavaScript
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/617826/whats-a-c-regular-expression-thatll-validate-currency-float-or-integer">What&#39;s a C# regular expression that&#39;ll validate currency, float or integer?</a>  </p>
  </blockquote>
  
  
  
  <p>How can I validate currency amount using regular expressions in JavaScript?</p>
  
  <p><em>Decimals separator:</em> <code>,</code></p>
  
  <p><em>Tens, hundreds, etc. separator:</em> <code>.</code></p>
  
  <p><em>Pattern:</em> <code>###.###.###,##</code> </p>
  
  <p>Examples of valid amounts:</p>
  
  <pre><code>1
  1234
  123456
  
  1.234
  123.456
  1.234.567
  
  1,23
  12345,67
  1234567,89
  
  1.234,56
  123.456,78
  1.234.567,89
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>I forgot to mention that the following pattern is also valid: <code>###,###,###.##</code></p>