Skip to content

Instantly share code, notes, and snippets.

@michaelminter
Created December 12, 2013 21:39
Show Gist options
  • Save michaelminter/7935999 to your computer and use it in GitHub Desktop.
Save michaelminter/7935999 to your computer and use it in GitHub Desktop.
Get matched content from a regex # ruby search string
v = 'foobar'
if v =~ /^foo(bar)$/
puts $1 # => "bar"
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment