If you have a problem with preg_replace or other PCRE functions in php, because they fail silently, without error message or other feedback, especially with large strings, then have a look at this php.ini setting:
For example, modify the value in your php script:
[php] ini_set(‘pcre.backtrack_limit’, ‘100000000’);[/php]
Just increase the default value of 1.000.000. Maybe you have to increase the value for memory_limit as well.