Re: Email Verfication Regular Expression

From: Steve Atkins <steve(at)blighty(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Email Verfication Regular Expression
Date: 2005-09-13 16:57:09
Message-ID: 20050913165709.GB23031@gp.word-to-the-wise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Tue, Sep 13, 2005 at 12:59:43PM +0200, Stephane Bortzmeyer wrote:
> On Wed, Sep 07, 2005 at 12:21:45PM -0700,
> Steve Atkins <steve(at)blighty(dot)com> wrote
> a message of 26 lines which said:
>
> > /^[^(at)]*@(?:[^(at)]*\(dot))?[a-z0-9-_]+\.(?:a[defgilmnoqrstuwz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvxyz]|d[ejkmoz]|e[ceghrst]|f[ijkmorx]|g[abdefhilmnpqrstuwy]|h[kmnrtu]|i[delnoqrst]|j[mop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrtwy]|qa|r[eouw]|s[abcdeghijklmnortvyz]|t[cdfghjkmnoprtvwz]|u[agkmsyz]|v[aceginu]|w[fs]|y[etu]|z[amw]|edu|com|net|org|gov|mil|info|biz|coop|museum|aero|name|pro)$/
>
> Very bad idea to hardcode the list of TLD. You are already late
> (".jobs" and ".travel" are in the ICANN root).

And are in my production code (despite being unusued, as yet).

If you want to validate email addresses you _must_ check the TLD as
part of the sanity checking, as many of the typos that are
theoretically detectable are detectable by that check.

Yes, you need to maintain that list correctly. But the list does not
change often enough that keeping it in a dynamic table with the many
orders of magnitude higher overhead makes any sense at all.

Not hardcoding the list of TLDs would be a bad idea, if you need
both performance and correctness.

Cheers,
Steve

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Celia McInnis 2005-09-13 17:05:50 Using COPY command when input file contain backslashes?
Previous Message Welty, Richard 2005-09-13 16:53:56 Re: Replication