static Pair replaceNumbersWithVars_returnMap(S s, final F0 varMaker) { final new SS map; ret pair(regexpReplace(s, "\\d+", func(Matcher m) -> S { S number = m.group(); S var = map.get(number); if (var == null) map.put(number, var = varMaker!); ret var; }), map); }