private String formatListValue(String value, boolean isSelected) {

			//
			// We format the matching part of the given value by using HTML to highlight the match.
			// Since we use HTML, any HTML inside of value will interfere with the HTML we add here.
			// To prevent this interference, we must escape the HTML inside of value.
			//

			// Rebuild the content by collecting all parts of the string, matching and non-matching.
			// Normally we would use the matcher to append content to the string buffer, but that
			// prevents us from being able to fix the HTML at the right time.
			Matcher matcher = model.lastConstraint.getHighlightMatcher(value);
			Color color = isSelected ? Palette.YELLOW : Palette.MAGENTA;
			StringBuilder sb = new StringBuilder("<html>");

			int start = 0;

			// find and highlight all instances of the user-defined pattern
			while (matcher.find()) {

				String group = matcher.group(1);
				int nextStart = matcher.start();
				String previousText = value.substring(start, nextStart);
				start = matcher.end();
				sb.append(HTMLUtilities.escapeHTML(previousText));

				// escape all unescaped '\' and '$' chars, as Match.appendReplacement() will treat
				// them as regex characters
				String quoted = Matcher.quoteReplacement(group);
				String escaped = HTMLUtilities.escapeHTML(quoted);
				String replacement = HTMLUtilities.colorString(color, HTMLUtilities.bold(escaped));
				sb.append(replacement);
			}

			String trailing = value.substring(start, value.length());
			sb.append(HTMLUtilities.escapeHTML(trailing));

			return sb.toString();
		}
Cell renderer for suggestion candidates. Substrings that match the models' query are
highlighted for ease-of-use.
Ghidra/Framework/Docking/src/main/java/docking/widgets/table/constrainteditor/AutocompletingStringConstraintEditor.java