static List<WordLocation> getCommentAnnotations(String comment) {

		List<WordLocation> starts = new ArrayList<>();
		Matcher matcher = ANNOTATION_START_PATTERN.matcher(comment);
		while (matcher.find()) {
			int position = matcher.start();
			String text = matcher.group();
			starts.add(new WordLocation(comment, text, position));
		}

		List<WordLocation> results = new ArrayList<>();

		for (WordLocation word : starts) {
			int start = word.getStart();
			int offset = start + word.getWord().length();
			int end = findAnnotationEnd(comment, offset);
			if (end != -1) {
				String annotation = comment.substring(start, end);
				results.add(new WordLocation(comment, annotation, start));
			}
		}

		return results;
	}
Split the given text into parts where the returned list contains either a String or 
an Annotation

@param text the text to parse
@param fixerUpper a function that is given a chance to convert an Annotation into a new one
@param program the program
@return a list that contains a mixture String or an Annotation entries
Ghidra/Features/Base/src/main/java/ghidra/app/util/viewer/field/CommentUtils.java