public static boolean isWholeWord(String text, int startIndex, int length) {
		if (startIndex > 0) {
			if (Character.isJavaIdentifierPart(text.charAt(startIndex - 1))) {
				return false;
			}
		}
		int endIndex = startIndex + length;
		if (endIndex < text.length()) {
			if (Character.isJavaIdentifierPart(text.charAt(endIndex))) {
				return false;
			}
		}

		return true;
	}
Returns true if the substring within the text string starting at startIndex and having the
given length is a whole word. A whole word is defined as the character before and after the
occurrence must not be a JavaIdentifierPart.

@param text the text containing the potential word.
@param startIndex the start index of the potential word within the text.
@param length the length of the potential word
@return true if the substring within the text string starting at startIndex and having the
        given length is a whole word.
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java