str_replace changed to preg_replace