}
if (item.isGroup()) {
$('#' + item.getDomId()).css("display", "none");
} else {
OptionItem option = (OptionItem) item;
if (!(chosen.isMultiple() && option.isSelected())) {
boolean found = false;
String resultId = option.getDomId();
GQuery result = $("#" + resultId);
String optionContent = option.getHtml();
if (regex.test(optionContent)) {
found = true;
results++;
} else if (optionContent.indexOf(" ") >= 0 || optionContent.indexOf("[") == 0) {
String[] parts = optionContent.replaceAll("\\[|\\]", "").split(" ");
for (String part : parts) {
if (regex.test(part)) {
found = true;
results++;
}
}
}
if (found) {
String text;
if (searchText.length() > 0) {
text = zregex.replace(optionContent, "<em>$1</em>");
} else {
text = optionContent;
}
result.html(text);
chosen.resultActivate(result);
if (option.getGroupArrayIndex() != -1) {
$("#" + selectItems.get(option.getGroupArrayIndex()).getDomId()).css("display",
"list-item");
}
} else {
if (chosen.getResultHighlight() != null
&& resultId.equals(chosen.getResultHighlight().attr("id"))) {