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

Re: Migrating between versions. Problem with regexp

From: Kaloyan Iliev Iliev <news1(at)faith(dot)digsys(dot)bg>
To: pgsql-general(at)postgresql(dot)org
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: Migrating between versions. Problem with regexp
Date: 2004-08-29 16:12:26
Message-ID: 4132006A.8050307@faith.digsys.bg (view raw or flat)
Thread:
Lists: 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(at)faith(dot)digsys(dot)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
>
>
>
>  
>

In response to

Responses

pgsql-general by date

Next:From: Stephan SzaboDate: 2004-08-29 16:33:33
Subject: Re: Primary key inheritance problem
Previous:From: Kaloyan Iliev IlievDate: 2004-08-29 15:17:13
Subject: Re: Migrating between versions. Problem with regexp

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