Received: from candle.pha.pa.us (maillist@s5-03.ppp.op.net [209.152.195.67]) by hub.org (8.9.3/8.9.3) with ESMTP id OAA39976; Wed, 7 Jul 1999 14:27:29 -0400 (EDT) (envelope-from maillist@candle.pha.pa.us) Received: (from maillist@localhost) by candle.pha.pa.us (8.9.0/8.9.0) id OAA05675; Wed, 7 Jul 1999 14:25:26 -0400 (EDT) From: Bruce Momjian Message-Id: <199907071825.OAA05675@candle.pha.pa.us> Subject: Re: [HACKERS] Broken select on regular expression !!! In-Reply-To: <3742C185.F57328C0@flex.ro> from Constantin Teodorescu at "May 19, 1999 01:49:57 pm" To: Constantin Teodorescu Date: Wed, 7 Jul 1999 14:25:26 -0400 (EDT) CC: PostgreSQL Interfaces , "pgsql-hackers@postgreSQL.org" X-Mailer: ELM [version 2.4ME+ PL56 (25)] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Fixed in 6.5 final. > 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 > > -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill, Pennsylvania 19026