@Override
	public void findAll(Program program, SearchAndReplaceQuery query,
			Accumulator<QuickFix> accumulator, TaskMonitor monitor) throws CancelledException {

		Listing listing = program.getListing();
		long count = listing.getCommentAddressCount();
		monitor.initialize(count, "Searching Comments...");

		Pattern pattern = query.getSearchPattern();
		String replaceMentText = query.getReplacementText();

		for (Address address : listing.getCommentAddressIterator(program.getMemory(), true)) {
			monitor.checkCancelled();
			CodeUnitComments comments = listing.getAllComments(address);
			for (CommentType type : CommentType.values()) {
				String comment = comments.getComment(type);
				String newComment = checkMatch(pattern, comment, replaceMentText);
				if (newComment != null) {
					accumulator.add(
						new UpdateCommentQuickFix(program, address, type, comment, newComment));
				}
			}
		}
	}
{@link SearchAndReplaceHandler} for handling search and replace for listing comments on 
instructions or data.
Ghidra/Features/Base/src/main/java/ghidra/features/base/replace/handler/ListingCommentsSearchAndReplaceHandler.java