public static WordLocation findWordLocation(String s, int index, char[] charsToAllow) {

		int len = s.length();
		if (index < 0 || index >= len) {
			return WordLocation.empty(s);
		}

		char currChar = s.charAt(index);
		if (!isWordChar(currChar, charsToAllow)) {
			String substring = s.substring(index, index + 1);
			WordLocation wordLocation = new WordLocation(s, substring.trim(), index);
			return wordLocation;
		}

		int start = index;
		int end = index;
		for (; start >= 0; --start) {
			char c = s.charAt(start);
			if (!isWordChar(c, charsToAllow)) {
				break;
			}
		}

		for (; end < s.length(); ++end) {
			char c = s.charAt(end);
			if (!isWordChar(c, charsToAllow)) {
				break;
			}
		}

		int wordIndex = start + 1;
		String substring = s.substring(wordIndex, end);
		WordLocation wordLocation = new WordLocation(s, substring.trim(), wordIndex);
		return wordLocation;
	}
Finds the word at the given index in the given string; if the word contains the given
charToAllow, then allow it in the string. For example, the string "The tree* is green" and
the index of 5, charToAllow is '*', then the result would be "tree*".
<p>
If the search yields only whitespace, then the empty string will be returned.

@param s the string to search
@param index the index into the string to "seed" the word.
@param charsToAllow chars that normally would be considered invalid, e.g., '*' so that the
           word can be returned with the charToAllow
@return String the word contained at the given index.
Ghidra/Framework/Generic/src/main/java/ghidra/util/StringUtilities.java