Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Re: Validating an email address

Reply
Thread Tools

Re: Validating an email address

 
 
Jean-Paul Calderone
Guest
Posts: n/a
 
      12-09-2005
On Fri, 9 Dec 2005 11:10:04 +0000, Tom Anderson <(E-Mail Removed)> wrote:
>Hi all,
>
>A hoary old chestnut this - any advice on how to syntactically validate an
>email address? I'd like to support both the display-name-and-angle-bracket
>and bare-address forms, and to allow everything that RFC 2822 allows (and
>nothing more!).
>
>Currently, i've got some regexps which recognise a common subset of
>possible addresses, but it would be nice to do this properly - i don't
>currently support quoted pairs, quoted strings, or whitespace in various
>places where it's allowed. Adding support for those things using regexps
>is really hard. See:
>
>http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html
>
>For a level to which i am not prepared to stoop.
>
>I hear the email-sig are open to adding a validation function to the email
>package, if a satisfactory one can be written; i would definitely support
>their doing that.


The top part of <http://divmod.org/users/viewcvs.twistd/branches/exarkun/smtp-2418/quotient/proto/smtp.py?rev=7661&view=markup> contains a parser that, IIRC, is basically complete. There are unit tests nearby, too. The code is MIT licensed.

Jean-Paul
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Validating Multiple E-mail Address - JavaScript & CustomValidator cemcat ASP .Net 1 12-19-2005 04:44 PM
Validating an email address Tom Anderson Python 3 12-10-2005 01:24 AM
Validating User Input (numeric only, and valid email address attributes) charleswesley@gmail.com ASP .Net 2 10-01-2005 07:49 PM
Validating/Changing MSN Messenger email address Justin Weidmak Computer Support 2 07-04-2004 03:01 PM
code for validating IPv4 address qazmlp C Programming 14 07-29-2003 08:05 PM



Advertisments