fork(2) download
  1. String test = "1";
  2. String test2 = "2";
  3. Map map = ["test":test, "test2":test2];
  4. String txt = 'WHERE oid_2 = $$test$$ || oid_2 = $$test2$$';
  5. print txt.replaceAll(/\$\$(.*?)\$\$/) { k -> map[k[1]] ?: k[0] }
Success #stdin #stdout 0.88s 4456448KB
stdin
Standard input is empty
stdout
WHERE oid_2 = 1 || oid_2 = 2