Edit report at http://bugs.php.net/bug.php?id=54083&edit=1
ID: 54083 User updated by: zequez at gmail dot com Reported by: zequez at gmail dot com Summary: Greedy match doesn't match more than 99997 characters Status: Open Type: Bug Package: Regexps related -Operating System: +Operating System: Windows 7 PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Didn't tested in other operative systems... Previous Comments: ------------------------------------------------------------------------ [2011-02-24 01:24:01] zequez at gmail dot com Description: ------------ Greedy match doesn't match more than 99997 characters. If you try to greedy match more than 99997 characters it matches nothing. Test script: --------------- // 99997 string length $contents = ''; for ($i = 0; $i < 99997; ++$i) { $contents .= "a"; } preg_match('/^a*?$/', $contents, $match); var_dump($match); // 99998 string length $contents = ''; for ($i = 0; $i < 99998; ++$i) { $contents .= "a"; } preg_match('/^a*?$/', $contents, $match); var_dump($match); Expected result: ---------------- To match the whole $contents content in both cases. Actual result: -------------- The first case match the whole $contents content, but in the second one it match nothing. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54083&edit=1