code: public static List<String> match(List<String> patterns, String name) {
          List<String> matches = new ArrayList<String>();
          for (String pattern : patterns) {
              if (match(pattern, name)) {
                  matches.add(pattern);
              }
          }
          return matches;
      }
docs: Returns the matching patterns for the given string