code: 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;
  
      }
docs: 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.