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-07 21:26:08
Message-ID: 20050907212608.GB31267@gp.word-to-the-wise.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)blighty(dot)com> wrote:
> >
> > /^[^(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)$/
> >
> > This'll exclude email addresses like tv(at)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sebastian Hennebrueder 2005-09-07 21:57:20 Re: Debug plpgSQL stored procedures
Previous Message Jim C. Nasby 2005-09-07 21:15:01 Re: RAID0 and pg_xlog