00001 <?php 00022 function smarty_modifier_regex_replace($string, $search, $replace) 00023 { 00024 if (preg_match('!\W(\w+)$!s', $search, $match) && (strpos($match[1], 'e') !== false)) { 00025 /* remove eval-modifier from $search */ 00026 $search = substr($search, 0, -strlen($match[1])) . str_replace('e', '', $match[1]); 00027 } 00028 return preg_replace($search, $replace, $string); 00029 } 00030 00031 /* vim: set expandtab: */ 00032 00033 ?>