Looking at the MatchData docs:
It looks like I should be able to get an array from .captures with every
match. I swear I’ve done this before, but I was teaching a class today
and couldn’t figure out what’s going on in this simple example… maybe
I typed something wrong and just need another pair of eyes.
test = “word1 foo word2”
=> “word1 foo word2”
m = test.match /(word.)/
=> #<MatchData “word1” 1:“word1”>
testing the same string and expression in http://www.rubular.com yields
$ ruby -v
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0]
Can anyone give me a clue?
Thanks in advance,