Re: Select all invalid e-mail addresses - Mailing list pgsql-general

From Andrus
Subject Re: Select all invalid e-mail addresses
Date
Msg-id djb7o1$1r0g$1@news.hub.org
Whole thread Raw
In response to Re: Select all invalid e-mail addresses  ("Guy Rouillier" <guyr@masergy.com>)
Responses Re: Select all invalid e-mail addresses
Re: Select all invalid e-mail addresses
List pgsql-general
>> How to write a WHERE clause which selects e-mail addresses which
>> are surely wrong ?
>
> ... WHERE email !~ '...insert previously mentioned regex here...';

 Steve,

thank you.

I tried

SELECT   email  FROM customer
  WHERE  email !~

'/^[^@]*@(?:[^@]*\.)?[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)$/'

but got an error

ERROR:  invalid regular expression: invalid character range


I'm using

"PostgreSQL 8.0.2 on i686-pc-mingw32, compiled by GCC gcc.exe (GCC) 3.4.2
(mingw-special)"

Andrus.




pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: [pgsql-advocacy] Oracle buys Innobase
Next
From: Andrew Sullivan
Date:
Subject: Re: How to cluster Postgresql