1--TEST-- 2preg_replace() with array of failing regular expressions 3--INI-- 4pcre.backtrack_limit=100000 5--FILE-- 6<?php 7 8$text = '[CODE]<td align="$stylevar[right]">[/CODE]'; 9$result = preg_replace(array('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU'), '', $text); 10var_dump($text); 11var_dump($result); 12 13$result = preg_replace('#\[(right)\](((?R)|[^[]+?|\[)*)\[/\\1\]#siU', '', $text); 14var_dump($text); 15var_dump($result); 16 17echo "Done\n"; 18?> 19--EXPECTF-- 20string(58) "[CODE]<td align="$stylevar[right]">[/CODE]" 21NULL 22string(58) "[CODE]<td align="$stylevar[right]">[/CODE]" 23NULL 24Done 25