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 BA6B59FB1EF for ; Tue, 5 Sep 2006 11:18:33 -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 80925-05-4 for ; Tue, 5 Sep 2006 14:18:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey- Received: from pjetlic.mobart.hr (pjetlic.mobart.hr [80.80.51.10]) by postgresql.org (Postfix) with ESMTP id 432EE9FB224 for ; Tue, 5 Sep 2006 11:17:59 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by pjetlic.mobart.hr (Postfix) with ESMTP id 368F617A78 for ; Tue, 5 Sep 2006 16:17:58 +0200 (CEST) Received: from pjetlic.mobart.hr ([127.0.0.1]) by localhost (pjetlic [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 31334-06 for ; Tue, 5 Sep 2006 16:17:51 +0200 (CEST) Received: from mike.mobart.hr (mike.mobart.hr [192.168.10.94]) (using SSLv3 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) by pjetlic.mobart.hr (Postfix) with ESMTP id 53F0F17A6F for ; Tue, 5 Sep 2006 16:17:51 +0200 (CEST) Subject: Re: Postgres regexp matching failure? From: Mario Splivalo Reply-To: mario.splivalo@mobart.hr To: pgsql-sql@postgresql.org In-Reply-To: References: <1157451491.27799.6.camel@localhost.localdomain> Content-Type: text/plain Organization: Mob-Art Date: Tue, 05 Sep 2006 16:17:50 +0200 Message-Id: <1157465870.27799.39.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 Content-Transfer-Encoding: 7bit X-Virus-Scanned: by OpenSource AV+AS Mail Server X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200609/23 X-Sequence-Number: 26234 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. I also tried doublebackslashing, all the same. So, I guess it's obvious that postgres doesn't treat regular expressions the same way as java/perl/pyton/php/awk/sed do... Mario -- Mario Splivalo Mob-Art mario.splivalo@mobart.hr "I can do it quick, I can do it cheap, I can do it well. Pick any two."