#41107 [Opn->Bgs]: (.+?) will not match greater than 99,997 bytes
| From: | scottmac@php.net | Date: | Tue, 17 Apr 2007 01:53:07 +0000 |
| Subject: | #41107 [Opn->Bgs]: (.+?) will not match greater than 99,997 bytes | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-111574@lists.php.net to get a copy of this message | ||
ID: 41107
Updated by: scottmac@php.net
Reported By: brianm at dealnews dot com
-Status: Open
+Status: Bogus
Bug Type: PCRE related
Operating System: Mac and Linux
PHP Version: 5.2.1
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
pcre.backtrack_limit was added in PHP 5.2.0 this corresponds to
PCRE_EXTRA_MATCH_LIMIT or PCRE which limits the number of matches and by
default its 10,000.
Previous Comments:
------------------------------------------------------------------------
[2007-04-17 00:24:06] brianm at dealnews dot com
Description:
------------
Before submitting a bug, I consulted with Phillip Hazel, the maintainer
of PCRE. He tested up to over 400k of data with PCRE and had no
problems. So, I am thinking this is a PHP issue.
Basically, (.+?) will not match over 99,997 bytes. This worked in PHP
5.0 and all previous versions I have used.
Reproduce code:
---------------
<?php
$string = "<tag>".str_repeat("x", 99997)."</tag>";
if(preg_match('/<tag>(.+?)<\/tag>/', $string, $match)){
echo "Match 99997!\n";
}
$string = "<tag>".str_repeat("x", 99998)."</tag>";
if(preg_match('/<tag>(.+?)<\/tag>/', $string, $match)){
echo "Match 99998!\n";
}
?>
Expected result:
----------------
Match 99997!
Match 99998!
Actual result:
--------------
Match 99997!
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41107&edit=1