private static Set<String> matchGroup(String input) {
        int openingIndex = indexOfEither(input, OPEN_GROUP, OPEN_GROUP_2);
        if (openingIndex == -1) {
            return null;
        }

        int closingIndex = indexOfEither(input, CLOSE_GROUP, CLOSE_GROUP_2);
        if (closingIndex < openingIndex) {
            return null;
        }

        String before = input.substring(0, openingIndex);
        String after = input.substring(closingIndex + 1);
        String between = input.substring(openingIndex + 1, closingIndex);

        Set<String> results = new HashSet<>();

        for (ShorthandParser parser : PARSERS) {
            try {
                Iterator<String> extracted = parser.extract(between);
                if (extracted != null) {
                    while (extracted.hasNext()) {
                        results.add(before + extracted.next() + after);
                    }

                    // break after one parser has matched
                    break;
                }
            } catch (IllegalArgumentException e) {
                // ignore
            }
        }

        return results;
    }
Parses and expands the shorthand format.

@param s the string to expand
@return the expanded result
common/src/main/java/me/lucko/luckperms/common/node/utils/ShorthandParser.java