Email validator regex
Possible Duplicate:
Regexp recognition of email address hard?
Hi,
I would like to implement validator for only local part of the email address.
Any suggestions please welcome.
From the Email address article at wikipedia (Syntax section):
The local-part of the email address may use any of these ASCII characters:
The syntax is formally defined in RFC 5322 section 3.4.1 and RFC 5321. It is defined by a grammar in which the local part starts like this:
local-part = dot-atom / quoted-string / obs-local-part
atext = ALPHA / DIGIT / ; Printable US-ASCII
"!" / "#" / ; characters not including
"$" / "%" / ; specials. Used for atoms.
"&" / "'" /
"*" / "+" /
"-" / "/" /
"=" / "?" /
"^" / "_" /
"`" / "{" /
"|" / "}" /
"~"
atom = [CFWS] 1*atext [CFWS]
dot-atom-text = 1*atext *("." 1*atext)
dot-atom = [CFWS] dot-atom-text [CFWS]
...
Look at the following link. This is the best reference I found:
http://www.regular-expressions.info/email.html
链接地址: http://www.djcxy.com/p/92748.html上一篇: Sql脚本来查找无效的电子邮件地址
下一篇: 电子邮件验证器正则表达式