@Test public void matchMulti() { Substitution subs = new MatchResultSubstitution("$%", r1, r2); assertEquals("xxaayycczz$2%2", subs.substitute("xx$1yy%1zz$2%2")); r1 = getMatchResult("\\.(\\w+)\\.com/(.*)", "www.saga67.com/test.htm"); r2 = getMatchResult("a=(\\d+)&b=(\\d+)", "a=1&b=2&c=3"); assertEquals("\\saga67, $1, $x, .saga67.com/test.htm, saga67, test.htm, $3, %1, %x, a=1&b=2, 1, 2, %3, \\", new MatchResultSubstitution("$%", r1, r2) .substitute("\\\\$1, \\$1, $x, $0, $1, $2, $3, \\%1, %x, %0, %1, %2, %3, \\")); }
public final String substitute(String input) { if (input == null) { return null; } StringBuilder buf = new StringBuilder(); substitute(buf, input); return buf.toString(); }
Substitution { public final String substitute(String input) { if (input == null) { return null; } StringBuilder buf = new StringBuilder(); substitute(buf, input); return buf.toString(); } }
Substitution { public final String substitute(String input) { if (input == null) { return null; } StringBuilder buf = new StringBuilder(); substitute(buf, input); return buf.toString(); } Substitution();  Substitution(String replacementPrefixes); }
Substitution { public final String substitute(String input) { if (input == null) { return null; } StringBuilder buf = new StringBuilder(); substitute(buf, input); return buf.toString(); } Substitution();  Substitution(String replacementPrefixes); final String substitute(String input); final void substitute(StringBuilder buf, String input); }
Substitution { public final String substitute(String input) { if (input == null) { return null; } StringBuilder buf = new StringBuilder(); substitute(buf, input); return buf.toString(); } Substitution();  Substitution(String replacementPrefixes); final String substitute(String input); final void substitute(StringBuilder buf, String input);  }