code: public static boolean stringInPatterns(String s, List<Pattern> patterns) {
      for (Pattern pattern : patterns) {
        if (pattern.matcher(s).matches()) {
          return true;
        }
      }
      return false;
    }
docs: Determines whether a string matches one of the regex patterns.