Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static bool IsValidEmail(string email)
- {
- string pattern = @"^(([^<>()[\]\\.,;:\s@\""]+"
- + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"
- + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"
- + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"
- + @"[a-zA-Z]{2,}))$";
- Regex regex = new Regex(pattern);
- return regex.IsMatch(email);
- }
Advertisement
Add Comment
Please, Sign In to add comment