Skip site navigation (1) Skip section navigation (2)

Migrating between versions. Problem with regexp

From: Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>
To: pgsql-general(at)postgresql(dot)org
Subject: Migrating between versions. Problem with regexp
Date: 2004-08-29 11:14:51
Message-ID: 4131BAAB.7030107@faith.digsys.bg (view raw or flat)
Thread:
Lists: pgsql-general
Dear friends,

I have the following problem.

libvar=# select version();
                            version                            
----------------------------------------------------------------
 PostgreSQL 7.2.3 on i386-pc-bsdi4.0.1, compiled by GCC 2.7.2.1
(1 row)

libvar=# select '\\a\\à\\à\\.' ~ '\\a\\à\\à\\.';
 ?column?
----------
 f
(1 row)


=======================================

libvar=# select version();
                                                   
version                                                   
--------------------------------------------------------------------------------------------------------------
 PostgreSQL 8.0.0beta1 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 
3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk)
(1 row)

libvar=# select '\\a\\à\\à\\.' ~ '\\a\\à\\à\\.';
ERROR:  invalid regular expression: invalid escape \ sequence

I am using:
This is perl, v5.6.0 built for i386-bsdos
When I receive a text from CGI I made quotemeta over it to avoid symbols 
that may be met in regular expressions.
Then I made DBI->quote over the same string to avoid any sql injection;
The problem is that I use cyrillic and quotemeta put before every 
cyrillic character a \.
Then DBI->quote make \ to \\.
And then when I use this string in regular expression in Postgres I 
recevie an error in the new version of postgres.
Could anyone sugest solution to my problem.
10x in advance.
   Kaloyan

Responses

pgsql-general by date

Next:From: Tom LaneDate: 2004-08-29 14:14:53
Subject: Re: Migrating between versions. Problem with regexp
Previous:From: Bruce MomjianDate: 2004-08-29 03:40:43
Subject: Re: Regression errors on beta1?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group