Re: Email Verfication Regular Expression - Mailing list pgsql-general

From Steve Atkins
Subject Re: Email Verfication Regular Expression
Date
Msg-id 20050913165709.GB23031@gp.word-to-the-wise.com
Whole thread Raw
In response to Re: Email Verfication Regular Expression  (Stephane Bortzmeyer <bortzmeyer@nic.fr>)
Responses Re: Email Verfication Regular Expression
List 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@blighty.com> wrote
>  a message of 26 lines which said:
>
> >
/^[^@]*@(?:[^@]*\.)?[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


pgsql-general by date:

Previous
From: Csaba Nagy
Date:
Subject: Re: Replication
Next
From: "Welty, Richard"
Date:
Subject: Re: Replication