h = {"{{width}}"=>10, "{{length}}"=>20}s = "The dimension of the square is {{width}} and {{length}}"puts s.gsub(/\{\{(?:width|length)\}\}/, h)
Standard input is empty
The dimension of the square is 10 and 20
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!