Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XWWuX-0006vJ-Rm for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 20:42:09 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XWWuX-0003yu-81 for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 20:42:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XWWuV-0003wm-N9 for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 20:42:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XWWuR-000419-Jz for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 20:42:06 +0000 MIME-Version: 1.0 Subject: BUG #11478: regexp_matches regression in 9.2 To: pgsql-bugs@postgresql.org From: myon@debian.org Date: Tue, 23 Sep 2014 20:41:18 +0000 Message-ID: <20140923204118.17175.66823@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 11478 Logged by: Christoph Berg Email address: myon@debian.org PostgreSQL version: 9.2.9 Operating system: any Description: The following was reported in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=760564 : select regexp_matches('foo/bar/baz', '^([^/]+?)(?:/([^/]+?))(?:/([^/]+?))?$', ''); Correct 9.1 result: regexp_matches ---------------- {foo,bar,baz} Bad 9.2 and later result: regexp_matches ---------------- (0 rows) Removing the last or second-last ? brings the match back. Perl also thinks the regexp should match: $ perl -wle 'print "$1 $2 $3" if "foo/bar/baz" =~ m!^([^/]+?)(?:/([^/]+?))(?:/([^/]+?))?$!' foo bar baz (There should probably be much less ? in the regexp in the first place, but a regression/bug is a bug.) -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs