I need to match the Date string to be 1 or 2 numbers.
[StringLength(2)]
[RegularExpression(@"\d{1,2}", ErrorMessage = "Date must be 1- 2 numbers")]
public string Date { get; set; }
I will need to do similar with Year to match 4 digit character string. What am I doing wrong here please ?