Use Enumerator#grep for Ruby >= 1.9

String#grep does not exist in Ruby >= 1.9. String#lines returns Enumerator object (which has #grep) in Ruby >= 1.8