ID: 39405 Comment by: ludvig dot ericson at gmail dot com Reported By: spam at dragy dot de Status: Open Bug Type: PCRE related Operating System: Any PHP Version: 5.2.0 New Comment:
This is because of limits intentionally set, see the ini setting pcre.backtrack_limit. Previous Comments: ------------------------------------------------------------------------ [2006-11-06 18:45:23] spam at dragy dot de Description: ------------ The following preg_replace breaks when the string is => 24999 characters. Works perfectly fine with 24998 characters and worked fine with any strings in PHP 5.1.5. Reproduce code: --------------- <?php $string = str_repeat('a', 100000); echo preg_replace('#(^.*|.*)(\[(php|html|noparse)\].*\[/\\3])(.*|.*$)#siUe', '', $string); ?> Expected result: ---------------- 100.000 times 'a' Actual result: -------------- nothing ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=39405&edit=1