X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id D41119FB1EF for ; Tue, 5 Sep 2006 11:26:13 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 18147-05-3 for ; Tue, 5 Sep 2006 11:26:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from lists.commandprompt.com (host-130.commandprompt.net [207.173.203.130]) by postgresql.org (Postfix) with ESMTP id 97E7D9FB361 for ; Tue, 5 Sep 2006 11:21:22 -0300 (ADT) Received: from alvh.no-ip.org (201-221-202-127.bk11-dsl.surnet.cl [201.221.202.127]) (authenticated bits=0) by lists.commandprompt.com (8.13.7/8.13.6) with ESMTP id k85ELHNQ006021; Tue, 5 Sep 2006 07:21:18 -0700 Received: by alvh.no-ip.org (Postfix, from userid 1000) id 96F07C295B4; Tue, 5 Sep 2006 10:21:15 -0400 (CLT) Date: Tue, 5 Sep 2006 10:21:15 -0400 From: Alvaro Herrera To: Mario Splivalo Cc: pgsql-sql@postgresql.org Subject: Re: Postgres regexp matching failure? Message-ID: <20060905142115.GC21195@alvh.no-ip.org> Mail-Followup-To: Mario Splivalo , pgsql-sql@postgresql.org References: <1157451491.27799.6.camel@localhost.localdomain> <1157465870.27799.39.camel@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1157465870.27799.39.camel@localhost.localdomain> User-Agent: Mutt/1.5.13 (2006-08-11) X-Virus-Scanned: ClamAV version 0.88.3, clamav-milter version 0.88.3 on projects.commandprompt.com X-Virus-Status: Clean X-Greylist: Sender succeded SMTP AUTH authentication, not delayed by milter-greylist-1.6 (lists.commandprompt.com [192.168.2.159]); Tue, 05 Sep 2006 07:21:18 -0700 (PDT) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.278 tagged_above=0 required=5 tests=AWL, FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200609/24 X-Sequence-Number: 26235 Mario Splivalo wrote: > On Tue, 2006-09-05 at 08:42 -0500, Aaron Bono wrote: > > On 9/5/06, Mario Splivalo wrote: > > > > pulitzer2=# select 'stop works' ~ '^\s*(?:[\ > > +|-]|(?:[sS][tT][oO][pP]\b)).*$'; > > ?column? > > ---------- > > f > > (1 row) > > > > Here, postgres should return true, but it gives me false. > > > > > > \b is a back-space - is that what you are wanting there? If I remove > > it I get true. > > Actually, I'm not sure :) As I've mentioned, python/java/perl do as I > expected, postgres on the other hand doesn't. If \b was the backspace, > then I'd have trouble with '+mario test', and that one seems to be OK. No, because the \b is inside the "stop" arm of the |. You need to do *both*, double backslashes and get rid of \b (or at least understand what you actually mean with it ...) -- Alvaro Herrera http://www.CommandPrompt.com/ The PostgreSQL Company - Command Prompt, Inc.