Demos

Email Validation

Reset
Server Model
[EmailAddress]
public string EmailAddress { get; set; }
Partial Render
<input class="form-control" type="email" value="">
Server Model
[RegularExpression("^(([^<>()\\[\\]\\.,;:\\s@\\\"]+(\\.[^<>()\\[\\]\\.,;:\\s@\\\"]+)*)|(\\\".+\\\"))@(([^<>()[\\]\\.,;:\\s@\\\"]+\\.)+[^<>()[\\]\\.,;:\\s@\\\"]{2,})$",
ErrorMessage = "The {0} field is not a valid e-mail address.")]
public string EmailAddress { get; set; }
Partial Render
<input class="form-control" type="text" data-val-regex-pattern="^(([^<>()\[\]\.,;:\s@\"]+(\.[^<>()\[\]\.,;:\s@\"]+)*)|(\".+\"))@(([^<>()[\]\.,;:\s@\"]+\.)+[^<>()[\]\.,;:\s@\"]{2,})$" value="">
The checkboxes indicate the email address will pass client validation.
The first for the EmailAddress Attribute and the second for the Regex Attribute.

Valid Email Address List

Valid with Unicode error in C#: "js@contoso.中国"
Strange valid email addresses which fail server validation: "_______@example.com", "much.”more\ unusual”@example.com", "very.unusual.”@”.unusual.com@example.com", "very.”(),:;<>[]”.VERY.”very@\\ \"very”.unusual@strange.example.com".

Invalid Email Address List

Strange invalid email addresses which passes server validation: "email@111.222.333.44444".