sS rtrimAllLines(S s) { ret regexpReplaceWithFirstGroup(compileMultiLineRegexp("\\s+(\r\n|$)"), s); }