Paste2
Create Paste
Followup Paste
QR
irb(main):006:0> arr = {"test" => "blah", "102" => "hello"}
=> {"102"=>"hello", "test"=>"blah"}
irb(main):007:0> "102 test".gsub(/(\d+)/) {|m| arr[$1] }
=> "hello test"