Skip to content

Instantly share code, notes, and snippets.

@davidcelis
Last active December 15, 2015 18:39
Show Gist options
  • Save davidcelis/5305242 to your computer and use it in GitHub Desktop.
Save davidcelis/5305242 to your computer and use it in GitHub Desktop.
ruby.
>> 'hi' =~ /(?<xx>.*)/
# => 0
>> xx
# NameError: undefined local variable or method `xx' for main:Object
>> /(?<xx>.*)/ =~ "hi"
# => 0
>> xx
# => "hi"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment