code: public String[] match(String value) {
          if (value == null) {
              return null;
          }
          for (Pattern pattern : patterns) {
              Matcher matcher = pattern.matcher(value);
              if (matcher.matches()) {
                  int count = matcher.groupCount();
                  String[] groups = new String[count];
                  for (int j = 0; j < count; j++) {
                      groups[j] = matcher.group(j + 1);
                  }
                  return groups;
              }
          }
          return null;
      }
docs: Validate a value against the set of regular expressions
  returning the array of matched groups.
  
  @param value The value to validate.
  @return String array of the <i>groups</i> matched if
  valid or <code>null</code> if invalid