abstract sclass StringMatcher { // change matches only if returning true bool match(S pat, S input, SS matches); S apply(S input, SS matches); }