Trying to create a regex for Date in this format dd.MM.yyyy.
I want to use it with a DataAnnotation, like this
[RegularExpression(@"<theregex>")]
public DateTime Date { get; set; }
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I suggest that regex is not exactly the best way to do this. You haven’t given the context, so it’s hard to guess what you’re doing overall… but you might want to create a
DateExpressionattribute or such and then do:in wherever your converter is defined.