Limitations of preg_replace?

From: Date: Thu, 25 Oct 2007 08:57:06 +0000
Subject: Limitations of preg_replace?
Groups: php.general 
Request: Send a blank email to php-general+get-263634@lists.php.net to get a copy of this message
Hi. Are there any limitations of preg_replace and is there a way to change them (for example with ini_set)? I got a php 4.4.7 on a linux-webhoster which crashes without error-message on this script: <?php $txt = ""; for ($i = 0; $i < 2000; $i++) { $txt .= "<a href=\"helloworld.htm\" title=\"my title\"><img src=\"/mypic.jpg\"></a><br />\n"; } $txt = preg_replace("/<a(.*)href=\"\\index.htm\">/isU", "<a$1href=\"\\\">", $txt); print $txt; ?> If I loop only 1000 times or don't use (.*)->$1 on the regular expression, it works. It works as well on a local WAMP-Installation. Any ideas about that? __________________________________ Ihre erste Baustelle? Wissenswertes für Bastler und Hobby Handwerker. www.yahoo.de/clever

« previous php.general (#263634) next »