Fix string matching for special characters.