From: Florian Gross Date: 2005-03-28T07:29:48+09:00 Subject: Re: Iterating through the RE Group Variables (i.e., $1 thru $9) Randy Kramer wrote: > I've written a quick and dirty regular expression tester, but there's one > thing I'd like to try to clean up. > > At the moment, to display all the groups, I have a series of print statements > like: puts $~.captures Avoiding the perlish variable: if md = /foo(.+)bar(.+)qux/.match(str) then puts md.captures end or puts Regexp.last_match.captures