Created
February 12, 2012 18:07
-
-
Save anonymous/1809961 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
using System; | |
using System.Text.RegularExpressions; | |
class User | |
{ | |
int _id; | |
string _login; | |
string _password; | |
string _email; | |
public string Email | |
{ | |
set | |
{ | |
string pat = @" ^(?("")("".+?""@)| | |
(([0-9a-zA-Z]((\.(?!\.)) | |
|[-!#\$%&'\*\+/=\?\^`\{\}\| | |
~\w])*)(?<=[0-9a-zA-Z])@)) | |
(?(\[)(\[(\d{1,3}\.){3}\d{1,3}\])| | |
(([0-9a-zA-Z][-\w]*[0-9a-zA-Z]\.) | |
+[a-zA-Z]{2,6}))$"; // regexp mak | |
if (!(new Regex(pat)).IsMatch(value)) | |
throw new ArgumentOutOfRangeException("Email"); | |
_email = value; | |
} | |
get | |
{ | |
return _email; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment