static L matchAll(S pat, L l) { new L l2; new Matches m; for (S s : l) if (match(pat, s, m)) { l2.add(m); m = new Matches; } ret l2; }