From: tsasaki99 at yahoo dot co dot jp
Operating system: Debian GNU/Linux etch
PHP version: 5.2.0
PHP Bug Type: PCRE related
Bug description: PCRE Version 6.7 04-Jul-06 seems to have a bug
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 bug report at http://bugs.php.net/?id=40195&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=40195&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=40195&r=trysnapshot52
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=40195&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=40195&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=40195&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=40195&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=40195&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=40195&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=40195&r=support
Expected behavior: http://bugs.php.net/fix.php?id=40195&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=40195&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=40195&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=40195&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=40195&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=40195&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=40195&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=40195&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=40195&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=40195&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=40195&r=mysqlcfg