public static int skipContentsUntil(String args, int startIndex, int len, String keyword, boolean caseSensitive) {
        if (keyword == null || keyword.isEmpty()) {
            return Math.min(startIndex + 1, len);
        }

        int k = keyword.length();
        if (k == 1) {
            return skipContentsUntil(args, startIndex, len, keyword.charAt(0));
        }

        for (int i = startIndex; i < len; i++) {
            char ch = args.charAt(i);

            if (isQuote(ch)) {
                i = skipQuotedString(args, i, len, ch) - 1;
            } else if (isOpenBracket(ch)) {
                i = skipBrackets(args, i, len, ch) - 1;
            } else if (i + 1 < len) {
                char nextCh = args.charAt(i + 1);
                if (ch == '-' && nextCh == '-') {
                    i = skipSingleLineComment(args, i + 2, len) - 1;
                } else if (ch == '/' && nextCh == '*') {
                    i = skipMultiLineComment(args, i + 2, len) - 1;
                } else if (i + k < len) {
                    int endIndex = i + k;
                    String s = args.substring(i, endIndex);
                    if ((caseSensitive && s.equals(keyword)) || (!caseSensitive && s.equalsIgnoreCase(keyword))) {
                        return endIndex;
                    }
                }
            }
        }

        return len;
    }
Skip quoted string, comments, and brackets until seeing the {@code keyword}
or reaching end of the given string.

@param args          non-null string to scan
@param startIndex    start index
@param len           end index, usually length of the given string
@param keyword       keyword, null or empty string means any character
@param caseSensitive whether keyword is case sensitive or not
@return index of {@code endChar} or {@code len}
clickhouse-data/src/main/java/com/clickhouse/data/ClickHouseUtils.java