Created
August 5, 2018 22:52
-
-
Save vmussak/2105a5f76179ea4e6ce1ae34c6286da8 to your computer and use it in GitHub Desktop.
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
var listaDeEmails = new ListaDeEmails().Buscar(); | |
var emailRegex = @"^(?!\.)(""([^""\r\\]|\\[""\r\\])*""|([-a-z0-9!#$%&'*+/=?^_`{|}~]|(?<!\.)\.)*)(?<!\.)@[a-z0-9][\w\.-]*[a-z0-9]\.[a-z][a-z\.]*[a-z]$"; | |
foreach(var email in listaDeEmails) | |
{ | |
var regex = new Regex(emailRegex, RegexOptions.IgnoreCase); | |
var oEmailEstaValido = regex.IsMatch(email); | |
if (oEmailEstaValido) | |
{ | |
//Alguma operacão aqui... | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment