X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 2DEDB9FB21A for ; Tue, 5 Sep 2006 12:06:50 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 93513-09 for ; Tue, 5 Sep 2006 15:06:31 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 73C849FB1E7 for ; Tue, 5 Sep 2006 12:05:06 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from ls405.htnet.hr (ls405.t-com.hr [195.29.150.135]) by svr4.postgresql.org (Postfix) with ESMTP id 2D5635AF031 for ; Tue, 5 Sep 2006 15:05:02 +0000 (GMT) Received: from ls422.t-com.hr (ls422.t-com.hr [195.29.150.237]) by ls405.htnet.hr (Postfix) with ESMTP id 9B5801448F2; Tue, 5 Sep 2006 17:04:57 +0200 (CEST) Received: from ls422.t-com.hr (localhost.localdomain [127.0.0.1]) by ls422.t-com.hr (Qmlai) with ESMTP id 9069BC90048; Tue, 5 Sep 2006 17:04:57 +0200 (CEST) X-Envelope-Sender: mario.splivalo@mobart.hr Received: from 89-172-13-4.adsl.net.t-com.hr (89-172-13-4.adsl.net.t-com.hr [89.172.13.4])by ls422.t-com.hr (Qmlai) with ESMTP id F3ADE1308050; Tue, 5 Sep 2006 17:04:52 +0200 (CEST) Subject: Re: Postgres regexp matching failure? From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: Alvaro Herrera Cc: pgsql-sql@postgresql.org In-Reply-To: <20060905142115.GC21195@alvh.no-ip.org> References: <1157451491.27799.6.camel@localhost.localdomain> <1157465870.27799.39.camel@localhost.localdomain> <20060905142115.GC21195@alvh.no-ip.org> Content-Type: text/plain Organization: Mob-Art Date: Tue, 05 Sep 2006 17:03:53 +0200 Message-Id: <1157468633.10784.0.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-imss-version: 2.042 X-imss-result: Passed X-imss-scores: Clean:99.90000 C:2 M:4 S:5 R:5 X-imss-settings: Baseline:1 C:1 M:1 S:1 R:1 (0.0000 0.0000) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.52 tagged_above=0 required=5 tests=FORGED_RCVD_HELO, SPF_SOFTFAIL, UNPARSEABLE_RELAY X-Spam-Level: * X-Archive-Number: 200609/26 X-Sequence-Number: 26237 On Tue, 2006-09-05 at 10:21 -0400, Alvaro Herrera wrote: > 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 ...) > I know this might not be the right place for this question, but, how come (or better: why?) is above regexp macthed ok (ok as in 'the way I expected') when employed from java/perl/python? Mario