Fix preg_replace error from notice to deprecated