Paste Search Dynamic
Recent pastes
words
  1. # your code goes here
  2. words = { "chunk" => "bleb", "version" => "bar" }
  3. a = "pen"
  4. mt = "Opened completed {chunk} as version {version}"
  5. #print mt.gsub(a, "bleb")
  6. mt.scan(/{([^}:,]+)[^}+]*}/) { |ph| mt = mt.gsub("{#{ph[0]}}", words[ph[0]]) } # }#mt["version"] = "rep" }
  7. print mt
Parsed in 0.003 seconds