I'm studying about RegularExpression
, but I'm not getting it right.
In my Model
the property CPF
must be filled only by numbers:
[RegularExpression(@"[0-9]", ErrorMessage = "CPF deve conter apenas números")]
public string CPF { get; set; }
I wanted to understand how to validate using RegularExpression.