I want to search through a block of text and build an array of all
strings contained within this text that match a given pattern. I know
the following hack will work, but it seems like a misuse of the gsub
Assume that ‘text’ contains the block of text and that ‘pat’
is a Regexp instance containing the pattern to match.
matchingStrings = 
matchingStrings << m
Is there a cleaner and elegant way to do this?
Thanks in advance.