From: Alexey Petrushin Date: 2011-04-08T00:25:42+09:00 Subject: String.gsub with regex and block 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/.