EF Data Annotations Regular Expression
I need to check the correct expression for the first 5 digits are numbers, then a hyphen, and then one digit is an alphabet and the other is a numeric one.
ex: 23456-p5 or 12345-a3 something like that.
I tried something like this to start with
/^\d{5}-\d{2}$/
and in the model i are given so that we don't need to give ^ or $ in data annotations
[RegularExpression(@"d{5}-\d{2}")]
But I couldn't get it to work even that.
+3
source to share