Migrating between versions. Problem with regexp

Поиск
Список
Период
Сортировка
От Kaloyan Iliev Iliev
Тема Migrating between versions. Problem with regexp
Дата
Msg-id 4131BAAB.7030107@faith.digsys.bg
обсуждение исходный текст
Ответы Re: Migrating between versions. Problem with regexp  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Regression errors on beta1?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Migrating between versions. Problem with regexp