$rep) { $text = preg_replace("/$pat/$opts", $rep, $text); } return $text; }