Use Array#grep with a regexp instead of hand-rolled variant.

Patched from my iPhone.