replaced some deprecated preg_replace \e calls for php5.5 compatibility.