Skip to content

Instantly share code, notes, and snippets.

@leejarvis
Created March 1, 2011 14:07
Show Gist options
  • Save leejarvis/849171 to your computer and use it in GitHub Desktop.
Save leejarvis/849171 to your computer and use it in GitHub Desktop.
>> "1" =~ /(?<a>\d)/ && a
NameError: undefined local variable or method `a' for main:Object
from (irb):5
from /Users/lee/.rvm/rubies/ruby-1.9.2-p180/bin/irb:16:in `<main>'
>> /(?<a>\d)/ =~ "1" && a
=> "1"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment