Skip to content

Instantly share code, notes, and snippets.

@andrewvc
Created February 14, 2013 17:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andrewvc/4954362 to your computer and use it in GitHub Desktop.
Save andrewvc/4954362 to your computer and use it in GitHub Desktop.
irb(main):021:0> x = "foobar"
=> "foobar"
irb(main):022:0> x =~ /(foo)/
=> 0
irb(main):023:0> $1
=> "foo"
irb(main):024:0> Thread.new { x =~ /(bar)/; puts $1}.join
bar
=> #<Thread:0x007ff47a10cb58 dead>
irb(main):025:0> $1
=> "foo"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment