Received: from fullfeed.msn.fullfeed.com (fullfeed.msn.fullfeed.com [199.184.182.42]) by hub.org (8.9.2/8.9.1) with SMTP id MAA71511 for ; Tue, 30 Mar 1999 12:45:52 -0500 (EST) (envelope-from <@snapuser35.pacificcrest.net:andrew@compclass.com>) Received: from thatch2.compclass.com by fullfeed.msn.fullfeed.com (8.6.9/MSN-1.4) id LAA16110; Tue, 30 Mar 1999 11:45:46 -0600 Received: from snapuser35.pacificcrest.net by thatch2.compclass.com id aa10887; 30 Mar 99 11:47 CST Sender: andrew@compclass.com Message-ID: <37010D69.6D1868ED@compclass.com> Date: Tue, 30 Mar 1999 09:44:09 -0800 From: Andrew Merrill X-Mailer: Mozilla 4.04 [en] (X11; I; UnixWare 5 i386) MIME-Version: 1.0 To: pgsql-sql@hub.org Subject: regexp strangeness Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit I'm using PostgreSQL 6.4.2 regexps, and they don't seem to work the way I'm used to (Perl). Here's the records in a simple table: select * from t5 where name ~ 'bar'; name -------- bar abar xbar not abar (4 rows) I'd like to match the ones that begin with 'bar' or 'abar'. select * from t5 where name ~ '^a?bar'; name ---- abar (1 row) select * from t5 where name ~ '^bar|^abar'; name ---- (0 rows) Neither of these works. I looked at pgsql/src/backend/regex/re_format.7, and it claims that ^, ?, and | all work as expected. The type of name is varchar(30), in case that is relevant. Am I misunderstanding PostgreSQL's use of regexps, or is this a bug others have seen? Thanks for your help. Andrew Merrill