-
-
Notifications
You must be signed in to change notification settings - Fork 327
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
.IsValidEmail() reporting incorrect results #27
Comments
Hello @jasenf , Do you have a proposal to the Regex we should use? Last time I made a research about it, pretty much all regex has some flaw and it seems there is no consensus about which Regex to use. Best Regards, Jonathan Performance Libraries Runtime Evaluation |
I think it's fine as-is if you just allow the + sign. |
We will try to review it soon by using the syntax from here: https://en.wikipedia.org/wiki/Email_address It will not be perfect but we will change the regex to at least contains printable characters (which contains the plus sign) |
If you really want to make it validate email addresses, RegularExpressions probably isn't the way to go. The simplest way to cover everything would probably be to just try creating a new MailAddress object and catch if an exception is thrown OR re-implement the code that does the email address validation from the .NET framework (https://github.com/microsoft/referencesource/blob/master/System/net/System/Net/mail/MailAddressParser.cs) |
String extension method .IsValidEmail() is incorrectly reporting e-mails such as
[email protected]
as invalid. This is a valid RFC e-mail address, and one recommended by Google to alias existing inboxes.
The text was updated successfully, but these errors were encountered: