sclass NLStringMatcher_dollarVars_underscores_dollarDollar extends StringMatcher { // change matches only if returning true bool match(S pat, S input, SS matches) { pat = trim(pat); // full-string match with $$x if (startsWith(pat, "$$") && isDollarVar(pat)) ret strictPutIC(matches, pat, input); SS newMatches = matchDollarVarsIC_underscores(pat, input); ret newMatches != null && addMapToMapWithoutOverwritingIC(matches, newMatches); } S apply(S input, SS matches) { ret replaceVars(input, matches); } }