Re: Select all invalid e-mail addresses

From: Andrew Sullivan <ajs(at)crankycanuck(dot)ca>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Select all invalid e-mail addresses
Date: 2005-10-20 15:52:40
Message-ID: 20051020155240.GD9291@phlogiston.dyndns.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Oct 20, 2005 at 06:10:40PM +0300, Andrus wrote:
> >From this thread I got the regular expression

[snipped]

Note that that regular expression, which appears to be validating
TLDs as well, is incredibly fragile. John Klensin has actually
written an RFC about this very problem. Among other problems, what
do you do when a country code ceases to be? (There's a similar
problem that the naming bodies struggke with from time to time.)

I suggest that if you want to validate TLDs, you pull them off when
you write the data in your database, and use a lookup table to make
sure they're valid (you can keep the table up to date regularly by
checking the official IANA registry for them). At least that way you
don't have to change a regex every time ICANN decides to add another
TLD. (The regex is wrong anyway, I think: it doesn't have .mobi,
which has been announced although isn't taking registrations yet, and
it doesn't appear to have arpa, either.)

A

--
Andrew Sullivan | ajs(at)crankycanuck(dot)ca
Information security isn't a technological problem. It's an economics
problem.
--Bruce Schneier

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2005-10-20 15:55:38 Re: Select all invalid e-mail addresses
Previous Message Alban Hertroys 2005-10-20 15:35:30 3-state logic (was: Re: NULL != text ?)