[Tutor] re: Checking e-mail addresses

Charlie Clark charlie@begeistert.org
Fri Jan 31 04:08:03 2003


On 2003-01-31 at 06:48:35 [+0100], tutor-request@python.org wrote:
> You have to keep on mind that:=20
>=20
> - E-mail validation is NOT a trivial matter=20
I know but they do help. I'm tidying up a list of addresses for a=20
newsletter and there are lots of typos and things in there - over a=20
thousand invalid addresses so anything that helps is good. I used to run=20
the system myself and manually correct addresses or remove them when they=20
bounced but that was a few years ago...
=20
> If you are in mood for a chuckle, see the 'pure' regexp solution=20
> (compliant with now obsolete RFC822):
>=20
> http://www.foad.org/~abigail/Perl/url3.regex
aaagh! I'm allergic to perl
wow. It's amazing how "perverted" people's brains can get. That looks like=20
compiled code!
=20
> If 'almost there' (good enough) is what would please you, you can have a=20
> look at this JScript:
>=20
> http://www.interclasse.com/scripts/EMailValidatorCLS.php
Thanx, I've looked at it briefly. I think it would take *me* a long time to=20
transpose it to Python. If we could take this off-list and you could help=20
me I'll make and release the Python version.
=20
> that I've done some time ago, before 'seeing the light' (discovering=20
> Python). The same thing can be done in Python better and closer to the=20
> specs, but I do not think that effort in this direction is worthwhile=20
> after all.
I think this is a moot point. I like to catch errors as early as possible=20
providing the work required to do this isn't enuff to get you me a PhD=20
(actually I'd need a BSc beforehand ;-). Catching typos can be very useful=20
and I would guess a good solution will catch over 90% of most addresses=20
which works for me.

Charlei
--=20
Charlie Clark
Helmholtzstr. 20
D=FCsseldorf
D- 40215
Tel: +49-211-938-5360