fix warnings with preg_match