I have a register model with a regular expression, but in C# we have Regex.ValidateMatchTimeout to prevent DDoS attacks. The question is, how implement a regex with timelimit in a model?
A normal regex in my model:
[DataType(DataType.EmailAddress)]
[Required]
[Display(Name = "Email")]
[StringLength(80, ErrorMessage = "Email too large.")]
[RegularExpression(@"^([a-zA-Z0-9_.-]+)@(outlook|hotmail|yahoo)\.\w{2,}$", ErrorMessage = "Invalid email.")]
public string Email { get; set; }