Skip to content

Instantly share code, notes, and snippets.

@khash
Created February 16, 2012 15:19
Show Gist options
  • Save khash/1845574 to your computer and use it in GitHub Desktop.
Save khash/1845574 to your computer and use it in GitHub Desktop.
reg = /\${(?<key>.*?)}/
text.gsub(reg) do
key = $~[:key]
"the replacement"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment