Skip to content

Instantly share code, notes, and snippets.

/ruby.rb Secret

Created July 22, 2015 15:36
Show Gist options
  • Save anonymous/fa7581f9ca2256df9e21 to your computer and use it in GitHub Desktop.
Save anonymous/fa7581f9ca2256df9e21 to your computer and use it in GitHub Desktop.
Class foo
def bar ()
# Prints "Yes"
if ( /(?<=bodyContent=\').*(?=\')/ =~ message )
puts "Yes"
else
puts "No"
end
@body_data = /(?<=bodyContent=\').*(?=\')/.match(message)
puts body_data # undefined local variable or method `body_data' for ... NameError
def other ()
# Do something with body_data
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment