code: public static String disjunction(String[] patterns) {
      String regex = "";
      for (int i = 0; i < patterns.length; i++) {
        regex += patterns[i];
        if (i < patterns.length - 1) {
          regex += "|";
        }
      }
      return "(?:" + regex + ")";
    }
docs: <p>
  Form the disjunction of the given regular expression patterns. For example if patterns contains
  "a" and "b" then the disjunction is "(a|b)", that is, "a or b".
  </p>
  
  @param patterns
  an array of regular expression patterns
  @return a pattern that matches if any of the input patterns match