> match_data = line.match(/regular expression/)
> unless match_data[1].nil?

careful, match_data can be nil itself if there was no match.