private Pattern createPattern(boolean isRegEx, boolean isCaseSensitive, boolean isWholeWord) {
		int regExFlags = Pattern.DOTALL;
		if (!isCaseSensitive) {
			regExFlags |= Pattern.CASE_INSENSITIVE;
		}

		if (isRegEx) {
			return Pattern.compile(searchText, regExFlags);
		}

		String converted = UserSearchUtils.convertUserInputToRegex(searchText, false);
		if (isWholeWord) {
			converted = "\\b" + converted + "\\b";
		}

		return Pattern.compile(converted, regExFlags);
	}
Returns the maximum number of search matches to be found before stopping early.
@return the maximum number of search matches to be found before stopping early.
Ghidra/Features/Base/src/main/java/ghidra/features/base/replace/SearchAndReplaceQuery.java