switch ereg_replace to preg_replace