RegularExpression validation fails at ModelState.IsValid when input is 0.00
问题 I have a problem similar to this question I'm using MVC . I have added a regular expression 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. If I put in 0.00 as my rate , when I submit my form, ModelState.IsValid returns as false . [RegularExpression(@"^(\d+\.\d{1,2})$", ErrorMessage = "Please enter valid rate with 1 or 2 decimal places")] public double