From: Simon Strandgaard Date: 2004-03-26T02:24:29+09:00 Subject: Re: GString and XSS (Re: groovy) On Wed, 24 Mar 2004 14:29:06 +0000, gabriele renzi wrote: > 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 Agree. Has this been submitted as an RCR before? If not, it may be a good candidate for an RCR. -- Simon Strandgaard