rewrite preg_replace without evil eval