Re: Select all invalid e-mail addresses

From: Edmund <ebacon-xlii(at)onesystem(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Select all invalid e-mail addresses
Date: 2005-10-19 18:57:44
Message-ID: m3wtk9pc5z.fsf@elb_lx.onesystem.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Andrus" <eetasoft(at)online(dot)ee> writes:

> 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 ?
>

There was a thread here not so long ago about matching valid email addresses.
It's not so simple. You probably want to do a regex match - e.g.

select ... where email ~ '<regex>'

However the regex for all valid email possibilities is *VERY* complex.
see: http://www.ex-parrot.com/~pdw/Mail-RFC822-Address.html

You should probably search the maillist archives. ISTR that there were
some suggestions on how one might simplify the search space.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Guy Rouillier 2005-10-19 19:04:55 Re: Select all invalid e-mail addresses
Previous Message Dann Corbit 2005-10-19 18:53:56 Re: Select all invalid e-mail addresses