Re: Migrating between versions. Problem with regexp - Mailing list pgsql-general

From Kaloyan Iliev Iliev
Subject Re: Migrating between versions. Problem with regexp
Date
Msg-id 4132006A.8050307@faith.digsys.bg
Whole thread Raw
In response to Migrating between versions. Problem with regexp  (Kaloyan Iliev Iliev <news1@faith.digsys.bg>)
Responses Re: Migrating between versions. Problem with regexp
List pgsql-general
Dear Tom Lane,
I still haven't read all the documentation but I find the following.
If I escape with \\  latin  letters it OK, but if escape with \\
cyrillic letters then it is a mistake.

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

libvar=# select '\\a\\ÿ' ~* '\\a\\ÿ';
ERROR:  invalid regular expression: invalid escape \ sequence
libvar=# select '\\a\\ÿ' ~* '\\a\ÿ';
 ?column?
----------
 f
(1 row)

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

So I understand that you can't adapt it to all languages and alphabets
but in case this is an error and can be fixed I report it.
Kaloyan

Tom Lane wrote:

>Kaloyan Iliev Iliev <news1@faith.digsys.bg> writes:
>
>
>>libvar=# select '\\a\\à\\à\\.' ~ '\\a\\à\\à\\.';
>>ERROR:  invalid regular expression: invalid escape \ sequence
>>
>>
>
>7.4 and later are stricter about the use of \ than prior versions; see
>http://www.postgresql.org/docs/7.4/static/functions-matching.html#POSIX-ESCAPE-SEQUENCES
>You could go back to (approximately) the old behavior by changing
>regex_flavor to "extended".
>
>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend
>
>
>
>
>

pgsql-general by date:

Previous
From: Kaloyan Iliev Iliev
Date:
Subject: Re: Migrating between versions. Problem with regexp
Next
From: Stephan Szabo
Date:
Subject: Re: Primary key inheritance problem