private void updateSearchResults(String text, boolean useRegex) {
		if (searchResults != null) {
			if (!searchResults.isInvalid(text)) {
				return; // the current results are still valid
			}

			searchResults.removeHighlights();
		}

		SearchTask searchTask = new SearchTask(text, useRegex);
		TaskLauncher.launch(searchTask);
		searchResults = searchTask.getSearchResults();
		searchResults.applyHighlights();
	}
A class to find text matches in the given {@link TextComponent}.  This class will search for all
matches and cache the results for future requests when the user presses Next or Previous.  All
matches will be highlighted in the text component.  The match containing the cursor will be a 
different highlight color than the others.  When the find dialog is closed, all highlights are
removed.
Ghidra/Framework/Docking/src/main/java/docking/widgets/TextComponentSearcher.java