ID: 46664 Updated by: [EMAIL PROTECTED] Reported By: patrik dot hirvinen at nemein dot com -Status: Open +Status: Bogus Bug Type: *Regular Expressions Operating System: Mac OS X 10.5 PHP Version: 5.2.6 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. You've reached the backtrack limit, check preg_last_error() Previous Comments: ------------------------------------------------------------------------ [2008-11-25 12:12:26] patrik dot hirvinen at nemein dot com Also on at least on linux(debian) with PHP 5.2.0-8+etch11 ------------------------------------------------------------------------ [2008-11-25 12:08:50] patrik dot hirvinen at nemein dot com Description: ------------ preg_match fails for some patterns when the searched string exceeds around 100300 bytes. It matches for same strings if enough text is removed from the middle part which gets captured by the pattern when working correctly. Also the exact same regexp works fine for perl on unshortened output. Reproduce code: --------------- <?php //foo.html >= 100 kB $contents = file_get_contents("foo.html"); $matches = array(); preg_match('%<BODY\s*>.*?</H[1-6]>(.+?)</BODY>%si', $contents, $matches); //$matches is empty var_dump($matches); ?> Expected result: ---------------- array(1) { [0]=> string(12935) "/*lots of html*/ } Actual result: -------------- array(0) { } ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=46664&edit=1
