public static List<Integer> getGroupSizes(String source, InputMode mode) throws Exception {
		List<Integer> sizes = new ArrayList<>();

		int modeSize = (mode == InputMode.BINARY) ? 8 : 2;

		// First split the input string on the space boundary, so we have a list of all the
		// groups.
		String[] groups = source.trim().split("\\s+");

		// Now loop over each group, adding the size of each to the return list. Also do a check
		// on each group; if it isn't an exact byte, then throw an exception.
		for (String group : groups) {
			if (group.length() < modeSize || group.length() % modeSize != 0) {
				throw new Exception("input is not a full byte(s)");
			}
			sizes.add(group.length() / modeSize);
		}

		return sizes;
	}
Returns a list of the sizes of each group, in terms of bytes, in the input string. 
eg: if the input string is "1001 01 AAAA BB ABCDEF" the returned list will be 
{2, 1, 2, 1, 3}.

@param source
@param mode BINARY or HEX
@return
@throws Exception
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/instructionsearch/util/InstructionSearchUtils.java