Re: Postgres friendly RegEx?

From: "Jon Asher" <jon(dot)asher(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres friendly RegEx?
Date: 2006-12-12 23:03:10
Message-ID: d24c7af0612121503i15dcb853nd0d1e847aec29be@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Please ignore, my mistake in the translation to Pg regex !

On 12/12/06, Jon Asher <jon(dot)asher(at)gmail(dot)com> wrote:
>
> In Postgres, it appears to be returning false positives:
>
> select * from
> (select '52'::varchar As val) d
> where d.val ~ '-{0,1}\\d*\\.{0,1}\\d+\\^{0,1}\\d*\\.{0,1}\\d+'
>
> returns a record.
> In C++ only such values match: 45.2^3 or -45.2^3 or 10^2.5
>
>
> On 12/12/06, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> >
> > "Jon Asher" <jon(dot)asher(at)gmail(dot)com> writes:
> > > Anyone care to correct this regex for PostgreSQL? It works in C++ but
> >
> > > Postgres have no love for it:
> >
> > > -{0,1}\d*\.{0,1}\d+\^{0,1}\d*\.{0,1}\d+
> >
> > It works fine in Postgres, AFAICT. Maybe you forgot to double the
> > backslashes in a string literal? Otherwise, be more specific about
> > your problem.
> >
> > regards, tom lane
> >
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Gregory Stark 2006-12-12 23:04:46 Re: Online index builds
Previous Message Jon Asher 2006-12-12 23:01:15 Re: Postgres friendly RegEx?