private List<Range> getOperandRanges(String text, CodeUnit codeUnit) {
		if (text == null || text.isEmpty()) {
			return Collections.emptyList();
		}
		Instruction instruction = (codeUnit instanceof Instruction) ? (Instruction) codeUnit : null;
		ArrayList<Range> list = new ArrayList<>();
		int opIndex = 0;
		int textLength = text.length();
		int start = 0; // Start index in the text for the current operand.
		int separatorIndex = -1;
		// Need to get the separator between each of the operands because it can be something
		// other than a comma. The index for the operands is 0 based.
		// Calling getSeparator(opIndex) gets the separator that comes before the indicated operand.
		// There can be a separator that comes before the first operand too.
		String separator = (instruction != null) ? instruction.getSeparator(opIndex) : null;
		// Is there a separator before the first operand? If so, adjust the start.
		if (separator != null && !separator.isEmpty()) {
			separatorIndex = text.indexOf(separator, start);
			start = separatorIndex + separator.length();
		}
		// Get a start/end range of indexes for each operand.
		while (start < textLength) {
			++opIndex; // Increment the opIndex since we find the separator before an operand.
			separator = DEFAULT_OPERAND_SEPARATOR; // default separator
			if (instruction != null) {
				// Get the separator that follows the operand for opIndex-1.
				separator = instruction.getSeparator(opIndex);
			}
			// Get the index of the separator that follows the operand.
			separatorIndex =
				(separator != null && !separator.isEmpty()) ? text.indexOf(separator, start) : -1;
			if (separatorIndex == -1) {
				list.add(new Range(start, textLength - 1));
				start = textLength;
				continue;
			}
			list.add(new Range(start, separatorIndex - 1));
			// Move start to the beginning of the next operand.
			start = separatorIndex + separator.length();
		}
		return list;
	}
Gets an array of start/end positions for each operand within the operand field's full text. 
@param text the full text from the operand field
@param codeUnit the code unit whose operand text is provided
@return the operand ranges indicating the start and end offsets for each individual operand
within the text.
Ghidra/Features/Base/src/main/java/ghidra/features/base/codecompare/listing/ListingDiffHighlightProvider.java