From: gabriele renzi Date: 2004-03-24T23:29:28+09:00 Subject: Re: GString and XSS (Re: groovy) il Wed, 24 Mar 2004 22:48:29 +0900, Tanaka Akira ha scritto:: >> BTW: Why is 'm' of class String. It would be nice if it were >> an instance of MatchData. If it had been a MatchData object, >> then the following piece would have worked. >> >> str.gsub!(/(\s\w)(\w+)(\w\s)/) do |m| >> m[3] + m[2] + m[1] >> end following suggestion from flgr on #ruby-lang it would be nice to have gsub yielding a MatchData with to_str defined to still allow stuff like str.gsub(rgx) do |m| 'str'+m end