There's a few things you can do with enumerable methods
(Module: Enumerable (Ruby 3.1.2)) depending on what
you want to know from the match (just whether it's in there somewhere;
exactly where it is; all the keys that match; etc)
Personally, I'd recommend looking at "select" and "detect" methods as
a start, but here's a line using a loop (like you said
Run this at the console to see all of the positions of the matches shown.