At Tue, 28 Sep 1999 22:55:52 -0400, Jonathan Aseltine <aseltine / cs.umass.edu> wrote: > x = "a.b c.d" > x.gsub!(/(\w).(\w)/) {|i, j| <do something with the matched > subexpressions>} > Right now, Ruby only gives the entire matched string to the block. Try this: x.scan(/(\w)\.(\w)/) { |i| p i } i holds Array of matched groups, so you can retrieve each group via its indices. -- -- OZAWA -Crouton- Sakuro <mailto:crouton / duelists.org> <http://www.duelists.org/~crouton/>