From: Assaph Mehr Date: 2005-02-10T08:55:05+09:00 Subject: Re: How to mimic Perl's `s///' in Ruby? > raise "String error: #{str}" unless /^(\d+)\s+(.*)$/ =~ str > pid, name = $1, $2 One thing I've wondered about: is this thread safe? Is there a chance that between the first and second statements something will change the result of the global variables? I tend to use the more verbose: .. pid, name = str.match(/^(\d+)\s+(.*)$/).captures or .. pid, name = str.scan(/^(\d+)\s+(.*)$/).flatten Cheers, Assaph