Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- static class MyExtensions
- {
- public static bool IsValidEmailAddress(this string s)
- {
- Regex regex = new Regex(@"^(?("")("".+?(?<!\\)""@)|(([0-9a-z]((\.(?!\.))|[-!#\$%&'\*\+/=\?\^`\{\}\|~\w])*)(?<=[0-9a-z])@))" +
- @"(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])|(([0-9a-z][-\w]*[0-9a-z]*\.)+[a-z0-9][\-a-z0-9]{0,22}[a-z0-9]))$");
- return regex.IsMatch(s);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement