// We dropped the "***" support here (use match3 for that) static S[] find2(L pat, L tok) { for (int idx = 0; idx < tok.size(); idx += 2) { // TODO: subtract pat size from end index S[] result = find2(pat, tok, idx); if (result != null) return result; } return null; } static S[] find2(L pat, L tok, int idx) { if (idx+pat.size() > tok.size()) return null; new L result; for (int i = 1; i < pat.size(); i += 2) { S p = pat.get(i), t = tok.get(idx+i); if (eq(p, "*")) result.add(t); else if (!p.equalsIgnoreCase(t)) return null; } return toStringArray(result); }