From: Brian Candler Date: 2011-04-08T00:57:53+09:00 Subject: Re: String.gsub with regex and block Or if you are a ruby 1.9 user, you could use named capture groups instead. I'm not sure they make the regexp itself any clearer in this case though: "John Smith".gsub /(?.+)\s(?.+)/ do p [$~[:name],$~[:family]] end -- Posted via http://www.ruby-forum.com/.