title: Regex - Quantity Field
body: <p>I want to validate the contents of a quantity field using Javascript's Regular Expressions.</p>
  
  <p>Valid input would be an integer number, from zero upwards. If leading zeros could be removed too that would be great.</p>
  
  <p><strong>Examples</strong></p>
  
  <pre><code>1         Pass
  0         Pass
  01        Failed
  00        Failed
  -1        Failed
  1.1       Failed
  1000000   Pass
  </code></pre>
  
  <p>I have tried myself, but the best I got was...</p>
  
  <pre><code>var regex = /[0-9]{1,9}/;
  </code></pre>
  
  <p>...which doesn't fail on negative numbers, or numbers with leading zeros.</p>
  
  <p>Thanks!</p>