java - Email validator regex -
possible duplicate:
regexp recognition of email address hard?
hi,
i implement validator local part of email address.
any suggestions please welcome.
from email address article @ wikipedia (syntax section):
the local-part of email address may use of these ascii characters:
- uppercase , lowercase english letters (a–z, a–z)
- digits 0 9
- characters ! # $ % & ' * + - / = ? ^ _ ` { | } ~
- character . (dot, period, full stop) provided not first or last character, , provided not appear 2 or more times consecutively (e.g. john..doe@example.com).
the syntax formally defined in rfc 5322 section 3.4.1 , rfc 5321. defined grammar in local part starts this:
local-part = dot-atom / quoted-string / obs-local-part atext = alpha / digit / ; printable us-ascii "!" / "#" / ; characters not including "$" / "%" / ; specials. used atoms. "&" / "'" / "*" / "+" / "-" / "/" / "=" / "?" / "^" / "_" / "`" / "{" / "|" / "}" / "~" atom = [cfws] 1*atext [cfws] dot-atom-text = 1*atext *("." 1*atext) dot-atom = [cfws] dot-atom-text [cfws] ...
Comments
Post a Comment