Search Postgresql Archives

Re: Postgres friendly RegEx?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

 
On 12/12/06, Jon Asher <jon.asher@xxxxxxxxx> 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@xxxxxxxxxxxxx> wrote:
"Jon Asher" < jon.asher@xxxxxxxxx> 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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux