From: Sarah Allen Date: 2010-03-02T10:15:42+09:00 Subject: MatchData captures... expected two items, but got one? Looking at the MatchData docs: http://ruby-doc.org/core/classes/MatchData.html#M001278 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. $ irb >> test = "word1 foo word2" => "word1 foo word2" >> m = test.match /(word.)/ => # >> m.captures => ["word1"] testing the same string and expression in http://www.rubular.com yields two matches $ ruby -v ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.7.0] Can anyone give me a clue? Thanks in advance, Sarah -- Posted via http://www.ruby-forum.com/.