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

From Steve Atkins
Subject Re: Email Verfication Regular Expression
Date
Msg-id 20050907212608.GB31267@gp.word-to-the-wise.com
Whole thread Raw
In response to Re: Email Verfication Regular Expression  (Bruno Wolff III <bruno@wolff.to>)
List pgsql-general
On Wed, Sep 07, 2005 at 03:52:11PM -0500, Bruno Wolff III wrote:
> On Wed, Sep 07, 2005 at 12:21:45 -0700,
>   Steve Atkins <steve@blighty.com> wrote:
> >
> >
/^[^@]*@(?:[^@]*\.)?[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)$/
> >
> > This'll exclude email addresses like tv@tv, but the owners of such are used
> > to their being rejected, and it saves you from a lot of the usual miskeyed
> > addresses.
>
> Hard coding the top level domains seems like a bad idea. xxx might still get
> added.

Not hard-coding them is an even worse idea, if you're actually looking to
exclude bad email addresses.

Yes, it's a maintenance issue, but that's part of the job of handling
large numbers of email addresses.

> It also doesn't take into account there are non-icann roots that
> include other tlds.

If it's a non-icann TLD, it's not a valid internet email address.

Cheers,
  Steve

pgsql-general by date:

Previous
From: Scott Marlowe
Date:
Subject: Re: max number of triggers in a table
Next
From: "Jim C. Nasby"
Date:
Subject: Re: RAID0 and pg_xlog