fork download
  1. class T {
  2. public static void main(String[] args) {
  3. String s = "Match foo and bar and baz";
  4. String replaced = s.replaceAll("Match (.*) and (.*) and (.*)", "$1, $2, $3");
  5. System.out.println(replaced);
  6. }
  7. }
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
foo, bar, baz