static int regexpCount(S pattern, S s) { Matcher m = regexp(pattern, s); int n = 0; while (m.find()) ++n; ret n; }