how to check if a string is a valid email address (RFC822)?

John W. Baxter jwbnews at scandaroon.com
Wed May 24 19:22:39 EDT 2000


In article <8ghlok$2oe$1 at nnrp1.deja.com>, Otis Gospodnetic 
<otis at my-deja.com> wrote:

> Hello,
> 
> I need to parse some text and find all (RFC822 valid) email addresses
> in it.
> 
> Is there a module that can take a string and tell me if the string is a
> valid email address or not?
> 
> I am looking for something like Email::Valid or Email::Find modules for
> Perl.
> 

Well, you could start with the regular expression presented in Appendix 
B of "Mastering Regular Expressions" by Jeffrey E.F. Friedl (a "must 
have" IMHO).

But you likely want something more "drop-in-ready".  (In small print, 
this thing fits on one page of the appendix (barely).)

   --John

-- 
John W. Baxter   Port Ludlow, WA USA  jwbnews at scandaroon.com



More information about the Python-list mailing list