|
Posted by John Dunlop on 10/13/06 15:12
Jerry Stuckle:
> I did see a regex which would handle all possible addresses. Don't
> remember where I saw it off hand, but it was around 6500 chars long.
To give a rough idea to anyone who thinks it's easy, Jerry, point your
browser here:
http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
That regular expression purportedly validates the well-formedness of
RFC822 e-mail addresses excluding comments. In other words even that
monster couldn't validate e-mail addresses itself. Since RFC2822
obsoleted RFC822, the pattern would need to be even larger, because
RFC2822 allows obsolete productions from RFC822 as well as its own.
> Obviously it's not easy to validate email addresses!
Not half.
(Slightly pedantic, but validating e-mail addresses and validating
e-mail address syntax are two different things. Validating e-mail
addresses entails dicovering if the e-mail address is in use;
validating e-mail address syntax entails checking that the syntax
matches that allowed by RFC2822. Go on, witty retort: 'you're not
being pedantic; you're being pernickety'.)
Enjoy the weekend!
--
Jock
Navigation:
[Reply to this message]
|