#40195 [Opn->Asn]: PCRE Version 6.7 04-Jul-06 seems to have a bug

From: Date: Mon, 22 Jan 2007 21:43:20 +0000
Subject: #40195 [Opn->Asn]: PCRE Version 6.7 04-Jul-06 seems to have a bug
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-107913@lists.php.net to get a copy of this message
ID: 40195 Updated by: nlopess@php.net Reported By: tsasaki99 at yahoo dot co dot jp -Status: Open +Status: Assigned Bug Type: PCRE related Operating System: Debian GNU/Linux etch PHP Version: 5.2.0 -Assigned To: +Assigned To: andrei New Comment: I confirm this is a bug in pcre. so let's ask Andrei to upgrade PCRE to version 7, maybe for PHP 5.2.2 (assign back to me if you want me to do it). Previous Comments: ------------------------------------------------------------------------ [2007-01-22 14:59:41] tsasaki99 at yahoo dot co dot jp Description: ------------ PCRE (Perl Compatible Regular Expression library) Version 6.7 04-Jul-06 seems to have a bug. This version is included in PHP 5.2 and PHP 6. Consequently preg_match() function in PHP seems to inherit the bug. The main issue is summarized as follows. * case1 ^(/([a-z]*))*$ matches //abcde * case2 ^(/(?:[a-z]*))*$ doesn't match //abcde * case3 ^(/([a-z]*))*$ matches /a/abcde * case4 ^(/(?:[a-z]*))*$ matches /a/abcde The second regex should match. Not only PHP 5 but also PHP 6 CVS snapshot still includes PCRE version 6.7 04-Jul-06. So, I report the issue. The complete report and examination results are in http://geeklog.windy.cx/article.php/20070122224722545 Reproduce code: --------------- preg_match("@^(/(?:[a-z]*))*$@", "//abcde", &$m); var_dump($m); Expected result: ---------------- array(2) { [0]=> string(7) "//abcde" [1]=> string(6) "/abcde" } Actual result: -------------- array(0) { } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=40195&edit=1

« previous php.bugs (#107913) next »