private void findMnemonicOperandLocations(ListingField mnemonicField, ListingField opField) {

		MnemonicText mnemonicText = generateMnemonicSearchText(mnemonicField, opField);
		String text = mnemonicText.getText();
		Matcher matcher = searchPattern.matcher(text);
		boolean forward = options.isForward();
		int mnemonicLength = mnemonicText.mnemonicLength();
		while (matcher.find()) {
			int index = matcher.start();
			if (index > mnemonicLength) {
				break;
			}
			if (forward && index <= startIndex) {
				continue;
			}
			if (!forward && index >= startIndex) {
				break;
			}
			FieldFactory fieldFactory = mnemonicField.getFieldFactory();
			RowColLocation rc = mnemonicField.textOffsetToScreenLocation(index);
			int col = rc.col();

			if (index == mnemonicLength) {
				col++;
			}

			ProgramLocation loc = fieldFactory.getProgramLocation(rc.row(), col, mnemonicField);
			results.add(new TextSearchResult(loc, index));
		}

		adjustIterator();
	}
Returns the number of fields used in the match.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/searchtext/ListingDisplaySearcher.java