title: Regex check for digits with decimal place
body: <p>I have a regex in place for checking a price being entered. The price can not be a 5 figure sum or more, but can contain an option decimal number. So -</p>
  
  <ul>
  <li>1000 = allowed</li>
  <li>9999.99 = allowed</li>
  <li>10000 = not allowed</li>
  <li>100.000 = not allowed</li>
  </ul>
  
  <p>This is what I have so far, which is checking the number of decimals correctly, but isn't checking the amount of digits before the decimal place. What am I doing wrong?</p>
  
  <pre><code>var reg = new RegExp("^(\d{0,4})+(\.[0-9]{2})?$");
  </code></pre>