Ruby - Regular Expressions
What will be the output of the following Ruby code?
text = "cat and dog" match = text =~ /dog/ puts match
text = "cat and dog" match = text =~ /dog/ puts match
=~ returns the index of the first match or nil if no match.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions