public String group(int idx) {
            int len = scheme.groupCount();
            if (idx < len) {
                return scheme.group(idx);
            }
            idx = idx - len;
            len = host.groupCount();
            if (idx < len) {
                return host.group(idx);
            }
            idx = idx - len;
            len = port > 0 ? 1 : 0;
            if (idx < len) {
                return String.valueOf(port);
            }
            idx = idx - len;
            return path.group(idx);
        }
<p>Returns the input subsequence captured by the given group by this match. Groups are indexed from left to
right, starting at zero. Note that some groups may match an empty string, in which case this method returns
the empty string. This method never returns null.</p>

@param idx The index of the group to return.
@return The (possibly empty) substring captured by the group during matching, never <code>null</code>.
@throws IndexOutOfBoundsException If there is no group in the match with the given index.
jdisc_core/src/main/java/com/yahoo/jdisc/application/UriPattern.java