void () { StringWithId string = new StringWithId("FIRST-second"); MatchData data = regex("([A-z]+)-([A-z]+)").match(string, null); assertEquals("first+second+FIRST", SyntaxMatchUtils.replaceGroupsWithMatchDataInCaptures("${1:/downcase}+$2+$1", string, data)); }