|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2011-02-24 01:26 UTC] zequez at gmail dot com
-Operating System:
+Operating System: Windows 7
[2011-02-24 01:26 UTC] zequez at gmail dot com
[2011-02-24 04:38 UTC] zequez at gmail dot com
-Summary: Greedy match doesn't match more than 99997 characters
+Summary: Lazy match doesn't match more than 99997 characters
[2011-02-24 04:38 UTC] zequez at gmail dot com
[2011-02-24 13:24 UTC] aharvey@php.net
-Status: Open
+Status: Verified
[2011-02-24 13:24 UTC] aharvey@php.net
[2011-02-24 13:24 UTC] aharvey@php.net
-Package: Regexps related
+Package: PCRE related
[2011-02-24 13:24 UTC] aharvey@php.net
[2011-02-26 15:14 UTC] carsten_sttgt at gmx dot de
[2011-05-29 11:26 UTC] iliaa@php.net
-Status: Verified
+Status: Closed
-Assigned To:
+Assigned To: iliaa
[2011-05-29 11:26 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 00:00:01 2025 UTC |
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.