static S regexpReplaceWithFirstGroup(S s, S pat) { Matcher m = regexpIC(pat, s); new StringBuffer buf; while (m.find()) m.appendReplacement(buf, m.group(1)); m.appendTail(buf); ret str(buf); }