regcomp problems

Поиск
Список
Период
Сортировка
Искать

regcomp problems

От:
"Romolo Manfredini" <romolo@bicnet.it>
Дата:
Dear postgresql developers,
I have found a small annoying bug in the SQL parser,

executing the following query;

select * from table where field ~* '*';

or=20

select * from table where field ~* '+';

generate the following error:

regcomp failed with error repetition-operator operand invalid=20

the postgres I'm using is 7.0.3 compiled on linux 2.2.18

Best regards,
Romolo Manfredini

Re: regcomp problems

От:
Stephan Szabo <sszabo@megazone23.bigpanda.com>
Дата:
On Wed, 21 Mar 2001, Romolo Manfredini wrote:

> Dear postgresql developers,
> I have found a small annoying bug in the SQL parser,
> 
> executing the following query;
> 
> select * from table where field ~* '*';
> 
> or 
> 
> select * from table where field ~* '+';
> 
> generate the following error:
> 
> regcomp failed with error repetition-operator operand invalid 
> 
> the postgres I'm using is 7.0.3 compiled on linux 2.2.18

You're doing a regexp, both * and + have special meanings
in a regexp, you'll probably want to escape them (unfortunately
I think you need two backslashes to do it)
FAQ