title: Regex fails with decimal digits (.00) causes preg_match() to return FALSE
body: <p>I've got a prize input field in my form. Valid user input should always look like this:</p>
  
  <pre><code>1.00
  0.00
  10000.20
  100.25
  </code></pre>
  
  <p>Before the floating point there could be unlimited digits, after only 2 digits. I tried to achieve this with that regex:</p>
  
  <pre><code>/^([0-9]+)\.([0-9]{2})$/
  </code></pre>
  
  <p>If you check this out here: <a href="https://regex101.com/" rel="nofollow">https://regex101.com/</a> there is a match for the value <code>10.00</code>.</p>
  
  <p>But now in PHP I used <code>preg_match()</code> as follows:</p>
  
  <pre><code>!preg_match('/^([0-9]+)\.([0-9]{2})$/', $obj-&gt;getPrize());
  </code></pre>
  
  <ul>
  <li>10.00 returns true</li>
  <li>10.01 returns false</li>
  </ul>
  
  <p>Can anyone explain the difference? Why does <code>10.00</code> return true? I think <code>preg_match()</code> handles zeros differently, but how to achieve this task?</p>