Created
August 7, 2013 15:59
-
-
Save csharpforevermore/6175435 to your computer and use it in GitHub Desktop.
In ASP.NET MVC 4, using the Entity Framework (code first) approach, I needed to create a RegEx for emails - allowing uppercase or lowercase. This was the solution for me.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Required] | |
[RegularExpression(@"\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b", ErrorMessage = "Invalid email address")] | |
[DisplayName("E-mail addresss")] | |
public string Email { get; set; } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment