private String removeExcessStars(String s) {
		// There is never a reason to have 3 or more stars in the query. To avoid errors
		// creating a regex pattern, replace runs of 3 or more starts with two stars.
		// Later, the method that handles path globbing (**) chars, will either convert 
		// ** to a path matching expression, or if not valid in its location, to a
		// single * regex pattern.

		int start = s.indexOf("***");
		while (start >= 0) {
			int end = findFirstNonStar(s, start);
			s = s.substring(0, start + 2) + s.substring(end);
			start = s.indexOf("***");
		}
		return s;
	}
Class for matching symbol names with or without namespace paths and wildcards.
Ghidra/Features/Base/src/main/java/ghidra/app/util/navigation/SymbolMatcher.java