related: why is not (123 == 0123) in java?
For a phone number i am validating using MVC Data Annotations like below
[RegularExpression(@"^[\d]{3}$", ErrorMessage = "*")]
[Range(0, 999, ErrorMessage = "*")]
public int IntlCode { get; set; }
value 012 validates fine in Client side but does not on the server side, Could someone explain why or what is wrong
Because it is an
intit is stripping the leading0which will cause your regex to failTry