| From: | Scott Marlowe <smarlowe(at)g2switchworks(dot)com> | 
|---|---|
| To: | Andrus <eetasoft(at)online(dot)ee> | 
| Cc: | pgsql-general(at)postgresql(dot)org | 
| Subject: | Re: Select all invalid e-mail addresses | 
| Date: | 2005-10-25 19:10:21 | 
| Message-ID: | 1130267421.15546.164.camel@state.g2switchworks.com | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | 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(dot)(dot)soft(at)online(dot)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.
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Marc G. Fournier | 2005-10-25 19:19:21 | Re: [ANNOUNCE] PostgreSQL 8.1 Beta 4 | 
| Previous Message | Wes Williams | 2005-10-25 18:52:17 | Re: PostgreSQL vs mySQL, any performance difference for |