fix match when candidates contains special characters in regular expressions