|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-01-22 21:43 UTC] nlopess@php.net
[2007-02-09 19:58 UTC] nlopess@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 14:00:01 2025 UTC |
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) { }