hello,

if i indeed want to start using MatchData instead of the "warts" such
as $-variables in regular expressions, how do i go about writing code
blocks for String#sub et al if i want to get a match for a particular
group?

example:

puts 'a-b-c-'.gsub(/(.)-/) { $1 + '_' }

thanks
konstantin