static ItIT flexMatchIC_iterator(S pat, S input) { L tokPat = javaTokNPunctuation_plusAsterisk(pat), tokInput = javaTokNPunctuation_plusAsterisk(input); // fail if crucial words not found (could be optimized more) new L varIndices; for (int i = 1; i < l(tokPat); i += 2) { S t = tokPat.get(i); if (eq(t, "*")) varIndices.add(i); else if (isIdentifier(t) && !cicAtOddPosition(tokInput, t)) ret emptyItIt(); } // TODO: transform to iterator LL spreadInputs = ai_spreadCertainIndices_2(tokPat, tokInput, varIndices); ret mapI_notNulls(spreadInputs, tok -> { new Matches m; ret match(pat, tok, m) ? m : null; }); }