Probably a stupid question, but is there a way to use :gsub replacement
without $0 $1 $2 $3 (and without "\0\1\2\3")?

I would prefer something like:

    "John Smith".gsub /(.+)\s(.+)/ do |name, family|
      p [name, family]

      # instead of this
      p [$1, $2]
    end

-- 
Posted via http://www.ruby-forum.com/.