public PathMatcher excludeBranch(final String path) {
        warnRegexp();
        validatePath(path);
        excludedPatterns.add(Pattern.compile("^" + path + "(/.*)?$"));
        return this;
    }
Convenience method for excluding all paths starting with a prefix e.g. "/foo" would exclude "/foo", "/foo/bar", etc.

@param path the prefix for the paths to be excluded
@return this path matcher
pac4j-core/src/main/java/org/pac4j/core/matching/matcher/PathMatcher.java