I am using DataAnnotations in MVC for validation of PAN card number. If I Check my expression online on https://regex101.com/, it execute correctly. But when I am trying it in my application, it gives error message as shown in below image.
I don't understand why this fails. Well I have used following code to implement this in model. So how can I implement it?
[DisplayName("PAN Number")]
[Required(ErrorMessage = "* Please Enter PAN No.")]
[RegularExpression(@"/[A-Z]{5}\d{4}[A-Z]{1}/", ErrorMessage = "* Invalid PAN Number")]
public string US_PAN { get; set; }