private boolean matchesInner(String pathSpec) {
        values.clear();
        List<String> specElements = HttpURL.Path.parse(pathSpec).segments();
        boolean matchPrefix = false;
        if (specElements.size() > 1 && specElements.get(specElements.size() - 1).equals("{*}")) {
            matchPrefix = true;
            specElements = specElements.subList(0, specElements.size() - 1);
        }

        if (matchPrefix) {
            if (path.length() < specElements.size()) return false;
        }
        else { // match exact
            if (path.length() != specElements.size()) return false;
        }

        List<String> segments = path.segments();
        for (int i = 0; i < specElements.size(); i++) {
            if (specElements.get(i).startsWith("{") && specElements.get(i).endsWith("}")) // placeholder
                values.put(specElements.get(i).substring(1, specElements.get(i).length() - 1), segments.get(i));
            else if ( ! specElements.get(i).equals(segments.get(i)))
                return false;
        }

        rest = matchPrefix ? path.skip(specElements.size()) : null;

        return true;
    }
Create a new Path for matching the given URI against patterns, without any segment validation.
container-core/src/main/java/com/yahoo/restapi/Path.java