private LocationReferenceContext createMatchContext(List<TextLine> matches) {

			LocationReferenceContextBuilder builder = new LocationReferenceContextBuilder();
			for (TextLine line : matches) {
				if (!builder.isEmpty()) {
					builder.newline();
				}

				String text = line.getText();
				int start = line.getMatchStart();
				int end = line.getMatchEnd();
				builder.append(text.substring(0, start));
				builder.appendMatch(text.substring(start, end));
				builder.append(text.substring(end, line.length()));
			}

			return builder.build();
		}
Uses the given matcher to search for all matches, which may span multiple lines.
Ghidra/Features/DecompilerDependent/src/main/java/ghidra/app/plugin/core/search/DecompilerTextFinder.java