A little shorter:
`grep` takes a block, and I think `lines` is preferable to `split("\n")`:

```ruby
File.open(...).read.lines. # maybe just File.read.lines ?
  grep(/.../) { |match| match.scan(/.../) }.flatten
```