Guest User

Untitled

a guest
Feb 17th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.75 KB | None | 0 0
  1. ^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$
  2.  
  3. public bool ValidarEmail(String email)
  4. {
  5. String expresion;
  6. expresion = "^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,4})$";
  7.  
  8.  
  9. if (Regex.IsMatch(email, expresion))
  10. {
  11. if (Regex.Replace(email, expresion, String.Empty).Length == 0)
  12. {
  13. return true;
  14. }
  15. else
  16. {
  17. return false;
  18. }
  19. }
  20. else
  21. {
  22. return false;
  23. }
  24. }
  25.  
  26. tucorreo-@hotmail.com
  27. tucorreo_@hotmail.com
  28. tucorreo_._@hotmail.com
  29.  
  30. TUCORREO@hotmail.com
Add Comment
Please, Sign In to add comment