From: Todd Benson Date: 2008-04-02T23:31:41+09:00 Subject: Re: Regexp Capture Access On Wed, Apr 2, 2008 at 8:20 AM, Oliver Saunders wrote: > Given that: > > %r{(\w,)+}.match('a,b,c')[0] #=> "a,b," > > and > > %r{(\w,)+}.match('a,b,c')[1] #=> "b," > > How do I access the capture that contains "a,"? Maybe leave the plus symbol (+) out? r = /(\w,)/ r.match('hi,a,b,c')[1] => "i," I'd probably use #scan, or even #split, instead. Todd