private void findLocations(ListingField field) {
		String text = field.getText();
		boolean forward = options.isForward();

		Matcher match = searchPattern.matcher(text);
		while (match.find()) {
			int index = match.start();
			if (forward && index <= startIndex) {
				continue;
			}
			if (!forward && index >= startIndex) {
				break;
			}
			RowColLocation rc = field.textOffsetToScreenLocation(index);
			FieldFactory fieldFactory = field.getFieldFactory();
			ProgramLocation loc = fieldFactory.getProgramLocation(rc.row(), rc.col(), field);
			if ((loc != null) && !isSameLocation(loc)) { // loc will be null if field is clipped.			
				results.add(new TextSearchResult(loc, index));
			}
		}

		adjustIterator();
		startIndex = forward ? -1 : Integer.MAX_VALUE;
		startLocation = null;
	}
Returns the number of fields used in the match.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearcher.java