private boolean matches(String str, Pattern... patterns) {

        // Check given string against all provided patterns
        for (Pattern pattern : patterns) {

            // Fail overall test if any pattern fails to match
            Matcher matcher = pattern.matcher(str);
            if (!matcher.find())
                return false;

        }

        // All provided patterns matched
        return true;

    }
Returns whether the given string matches all of the provided regular
expressions.

@param str
    The string to test against all provided regular expressions.

@param patterns
    The regular expressions to match against the given string.

@return
    true if the given string matches all provided regular expressions,
    false otherwise.
extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/security/PasswordPolicyService.java