Hi,
In message "[ruby-talk:6227] MatchData#[](0)"
on 00/11/10, hal9000 / hypermetrics.com <hal9000 / hypermetrics.com> writes:
|Suppose you were doing something like capitalizing the vowels
|in a string:
|
| str.gsub(/aeiou]/) { $&.upcase }
|
|But suppose you didn't want to use $&, butt wanted to use a
|MatchData object md and reference md[0].
|
|Is there a good way?
1. use $~
2. use Regexp::last_match
matz.