private static int findNextButSkipLists(char[] chars, String s, int position) {
        for (; position<s.length(); position++) {
            if (s.charAt(position)=='[') {
                position = findNextButSkipLists(new char[]{']'}, s, position + 1);
                if (position<0) return -1;
            } else {
                for (char c : chars) {
                    if (s.charAt(position)==c)
                        return position;
                }
            }
        }
        return -1;
    }
Finds next index of a set of chars, but skips past any lists ("[...]").
@param chars Characters to find. Note that '[' should not be in this list.
@param s String to search
@param position position in s to start at.
@return position of first char from "chars" that does not appear within brackets.
container-search/src/main/java/com/yahoo/search/querytransform/BooleanAttributeParser.java