From:
Operating system: Windows XP SP3
PHP version: 5.2.13
Package: PCRE related
Bug Type: Bug
Bug description:preg_replace returns NULL, if in line more than 991 blanks
Description:
------------
One of my regular expressions leads to return of emptiness to functions
preg_replace if the initial line contains more than 991 blanks. Example
more low. The first line works, the second dies also I lose all contents.
Test script:
---------------
$text = 'test'.str_repeat(' ', 991).'test'; // work
$text = 'test'.str_repeat(' ', 992).'test'; // empty :(
if ($text = preg_replace('/(.*?\s+)"([^\s]+.*?)/', '$1<quot1>$2', $text))
{
echo "GOOD\n";
} else {
echo "BAD\n";
}
--
Edit bug report at http://bugs.php.net/bug.php?id=51963&edit=1
--
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=51963&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=51963&r=trysnapshot53
Try a snapshot (trunk):
http://bugs.php.net/fix.php?id=51963&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=51963&r=fixed
Fixed in SVN and need be documented:
http://bugs.php.net/fix.php?id=51963&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=51963&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=51963&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=51963&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=51963&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=51963&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=51963&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=51963&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=51963&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=51963&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=51963&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=51963&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=51963&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=51963&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=51963&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=51963&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=51963&r=mysqlcfg