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

From Scott Marlowe
Subject Re: Select all invalid e-mail addresses
Date
Msg-id 1130267421.15546.164.camel@state.g2switchworks.com
Whole thread Raw
In response to Re: Select all invalid e-mail addresses  ("Andrus" <eetasoft@online.ee>)
List pgsql-general
On Tue, 2005-10-25 at 13:01, Andrus wrote:
> >> This regex allows email addresses containing two dots without any
> >> letters,
> >> like eeta..soft@online.ee
> >
> > That's because the regular expression is wrong: it simply checks
> > the local part for zero or more non-@ characters instead of checking
> > against the RFC822/RFC2822 specification.  Use a search engine to
> > find a more complete regular expression (beware: it's long).
>
> Michael, thank you.
> I found correct regexp from
>
http://www.twilightsoul.com/Domains/Voyager/DeveloperVision/BestPracticesPatterns/EmailAddresses/tabid/134/Default.aspx?PageContentID=2
>
> but this needs to be converted to Postgres. It causes the famuous ERROR:
> invalid regular expression: invalid character range.
> Since text editor find/replace cannot be used to convert it it is probably
> not reasonable to waste time trying to make the following code to work in
> Postgres.
>
> Andrus.

PERL REGEX SNIPPED.

That's because it's a perl regex, not a posix or sql regex.  IF you
wrapped it in a plperl function, then you could use it.  Anyone know if
the PCRE library can handle this thing?   I guess I could try it myself.

pgsql-general by date:

Previous
From: "Andrus"
Date:
Subject: alt+F not working after calling pg_dump
Next
From: "Marc G. Fournier"
Date:
Subject: Re: [ANNOUNCE] PostgreSQL 8.1 Beta 4