title: RegularExpression validation fails at ModelState.IsValid when input is 0.00
body: <p>I have a problem similar to <a href="https://stackoverflow.com/questions/29169118/validation-still-fails-for-regular-expression-that-only-allows-numbers">this question</a></p>
  
  <p>I'm using <strong>MVC</strong>. I have added a <strong>regular expression</strong> in my ViewModel to force the users to enter a number with 1 or 2 decimal places. I am thinking there must be an error in my Regex but the same statement is working fine elsewhere.</p>
  
  <p><strong>If I put in 0.00 as my rate</strong>, when I submit my form, <strong>ModelState.IsValid returns as false</strong>.</p>
  
  <pre><code>[RegularExpression(@"^(\d+\.\d{1,2})$", ErrorMessage = "Please enter valid rate with 1 or 2 decimal places")]
  public double DecimalRate { get; set; }
  </code></pre>
  
  <ul>
  <li>If I type any invalid input, it behaves as expected, displaying the
  proper error message and not letting me save the page</li>
  <li>If I put valid input (other than 0.00), it saves properly.</li>
  <li>If I remove the Regex completely, 0.00 is seen as valid input and it
  saves properly.</li>
  </ul>
  
  <p>As per a suggestion in <a href="https://stackoverflow.com/questions/1791570/modelstate-isvalid-false-why">this question</a>, I have verified that this rate is causing the error by setting a debug at ModelState.IsValid in Visual Studio and checking the errors.</p>
  
  <p>I have a hunch it might have something to do with the attribute being of type <strong>double</strong>?</p>