Re: Select all invalid e-mail addresses

From: "Andrus" <eetasoft(at)online(dot)ee>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Select all invalid e-mail addresses
Date: 2005-10-20 15:10:40
Message-ID: dj8c4h$243o$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


""Guy Rouillier"" <guyr(at)masergy(dot)com> wrote in message
news:CC1CF380F4D70844B01D45982E671B239E8BE9(at)mtxexch01(dot)add0(dot)masergy(dot)com(dot)(dot)(dot)
> Andrus wrote:
>> I have a database of e-mail addresses.
>>
>> I want to select the email addresses which are not valid:
>>
>> do not contain exactly one @ character,
>> contain ; > < " ' , characters or spaces etc.
>>
>> What is the WHERE clause for this ?
>
> Please see a long, detailed thread in the archives titled "Email
> Verification Regular Expression" on Sept 7, 2005.

Guy Rouillier,

thank you.

I have emails in CHARACTER(60) type columns in database, total 3000 emails.
I need to check email addresses for most frequent typos before send.
I have only plpgsql language installed, no perl.

From this thread I got the regular expression

/^[^(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)$/How I can use this in where clause ? I havent never used regular expressionsin Postgres.How to exclude top-level domain names from this regex ?Andrus.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Andrew Sullivan 2005-10-20 15:22:06 Re: Oracle and PostgreSQL...
Previous Message Kevin Grittner 2005-10-20 14:53:37 Re: [HACKERS] 'a' == 'a ' (Was: RE: [pgsql-advocacy]