From:             brianm at dealnews dot com
Operating system: Mac and Linux
PHP version:      5.2.1
PHP Bug Type:     PCRE related
Bug description:  (.+?) will not match greater than 99,997 bytes

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 bug report at http://bugs.php.net/?id=41107&edit=1
-- 
Try a CVS snapshot (PHP 4.4): 
http://bugs.php.net/fix.php?id=41107&r=trysnapshot44
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=41107&r=trysnapshot52
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=41107&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=41107&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=41107&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=41107&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=41107&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=41107&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=41107&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=41107&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=41107&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=41107&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=41107&r=globals
PHP 3 support discontinued:   http://bugs.php.net/fix.php?id=41107&r=php3
Daylight Savings:             http://bugs.php.net/fix.php?id=41107&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=41107&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=41107&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=41107&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=41107&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=41107&r=mysqlcfg

Reply via email to