Bug #54083 [Opn]: Greedy match doesn't match more than 99997 characters

From: Date: Thu, 24 Feb 2011 00:26:45 +0000
Subject: Bug #54083 [Opn]: Greedy match doesn't match more than 99997 characters
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-158986@lists.php.net to get a copy of this message
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

« previous php.bugs (#158986) next »