Created
February 14, 2013 17:13
-
-
Save andrewvc/4954362 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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