I need an help to validate a string[]
field, since whenever I send this empty field, it returns error, even though it is in the correct format:
The field is this:
[RegularExpression(@"^(([A-Za-z0-9]+_+)|([A-Za-z0-9]+\-+)|([A-Za-z0-9]+\.+)|([A-Za-z0-9]+\++))*[A-Za-z0-9]+@((\w+\-+)|(\w+\.))*\w{1,63}\.[a-zA-Z]{2,6}$", ErrorMessage = "E-mail está em um formato inválido.")]
[Display(Name = "E-mail")]
public string[] Email { get; set; }
This field will not always be filled, but every time you send it blank null
, it will generate the error E-mail está em um formato inválido.
. It will be possible to send 1
to n
emails, I needed that every email that was sent was validated by the regular expression, would you know to help me?