replacing preg_replace with faster str_replace