# If unsuccessful,the method returns nil.
# On success,it returns an instance of class MatchData.
# And that MatchData object gives you access to all available in formation.
re = /cat/
puts re.class # Regexp
re = /(\d+):(\d+)/ # match a time hh:mm
md = re.match("Time: 12:34am")
puts md.class
puts md[0]
puts md[1]
puts md[2]
puts md.pre_match
puts md.post_match