Validating EMailAdresses for syntactical correctness

Krasna Halopti krasna.halopti at virgin.net
Fri Jan 25 05:46:30 EST 2002


Michael.W.Dietrich at modulo3.de (Michael W. Dietrich) wrote in message news:<54da4e24.0201241019.4a4b222e at posting.google.com>...
> Has anyone ever written a class, function or regular expression, that
> validates EMail-Addresses (e.g. such entered in Web Forms) for their
> syntactical correctness? If so, is that algorithm available? Where?
> 
> Any comments on this matter are appreciated.
> 
> regards
> Michael

I agree with all the other replies to your post about the caveats on
validation. However, I have found some uses, e.g. client-side
validation in forms to catch user typos. In Javascript, I have used
the re.

"^\\w(\\w|\\.\\w)*@\\w(\\w|\\.\\w)*$"

I have not tested this in Python but it should need only minor mods,
if any...since you mention Web forms in your post, it may be that you
can do this browser-side.

Hope this helps



More information about the Python-list mailing list