sS starToDotPlusRegexp(S s) { int i = 0; new StringBuffer buf; while (i < l(s)) { int j = smartIndexOf(s, "*", i); buf.append(regexpQuote(substring(s, i, j))); if (j >= l(s)) break; buf.append(".+"); i = j+3; } ret str(buf); }