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

Broken select on regular expression !!!

From: Constantin Teodorescu <teo(at)flex(dot)ro>
To: PostgreSQL Interfaces <pgsql-interfaces(at)postgresql(dot)org>, "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Broken select on regular expression !!!
Date: 1999-05-19 13:49:57
Message-ID: 3742C185.F57328C0@flex.ro (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-interfaces
Hi all,

I think I have found a bug in regexp based selections.
Watch this :

create table regdemo (fld1 varchar(32));
CREATE
insert into regdemo values('410');
INSERT 726409 1
insert into regdemo values('7410');
INSERT 726410 1
insert into regdemo values('source');
INSERT 726411 1
insert into regdemo values('destination');
INSERT 726412 1
select * from regdemo where fld1 ~* '^sou|^des';
fld1
-----------
source
destination
(2 rows)

select * from regdemo where fld1 ~* '41|^des';
fld1
-----------
410
7410
destination
(3 rows)

select * from regdemo where fld1 ~* '^41|^des';
fld1
----
(0 rows)

^^^^^^^^^^^^^^
!?!?!?!
I thought it should return '410' and 'destination' rows. But it returns
nothing!
The first select example with ^ in both variants ( ^sou|^des ) works !!!
The last one ( ^41|^des ) don't !

Am I missing something?
I am getting the same result also on 6.4.2 and 6.5 beta 1 versions!

Best regards,
-- 
Constantin Teodorescu
FLEX Consulting Braila, ROMANIA

Responses

pgsql-hackers by date

Next:From: Herouth MaozDate: 1999-05-19 13:52:54
Subject: Re: [SQL] Oddities with NULL and GROUP BY
Previous:From: secretDate: 1999-05-19 13:46:52
Subject: Re: [SQL] Oddities with NULL and GROUP BY

pgsql-interfaces by date

Next:From: selkovjrDate: 1999-05-19 13:57:13
Subject: Re: [INTERFACES] Paths in DBD::Pg
Previous:From: Peter HarveyDate: 1999-05-19 11:21:35
Subject: ANNOUNCE: unixODBC Beta 1.0.2

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