Chris Petersen [EMAIL PROTECTED] wrote:
> it's somewhat cryptic, but the following regex will match the RFC 822

No, it doesn't.  There have meen numerous long discussions in various Perl
newsgroups about the topic, and the conclusion is that you shouldn't try
to match e-mail addresses with a regular expression of your own, but use
the Email::Valid Perl module instead (or a similar module which does it
right, if you're using another language).

Have a look for the third occurrance of "RFC822PAT" in
http://search.cpan.org/src/MAURICE/Email-Valid-0.15/Valid.pm
to understand the complexity of the RFC 822 e-mail address syntax. ;-)

> (with the TLD's manually added by me, since the rfc isn't that
> specific):
> [...]
>    (?:[a-z\-0-9]+\.)+(?:biz|com|edu|gov|i?nfo|org|mil|net|[a-z]{2})

So what about ".aero" and ".museum"?  No, I don't think hard-coding a list
of valid TLDs is a good idea.



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE. 
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
courier-users mailing list
[EMAIL PROTECTED]
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/courier-users

Reply via email to