replaced preg_match with preg_replace