From: Robert Klemme Date: 2003-04-25T20:39:20+09:00 Subject: Re: Array String.match(Regexp) You can do: all, i, j, k = */delim(\S+):(\S+):(\S+)/.match($_).to_a robert "Vlada Soucek" schrieb im Newsbeitrag news:20030425101238.GA16956@artax.karlin.mff.cuni.cz... > Hi > > I'd like to know, what is the easiest way of doing the perlish > > ($i,$j,$k) = $_ =~ /delim(\S+):(\S+):(\S+)/ > > =~ operator in ruby returns nil/number > I have found just one solution, which uses global $variables. > > $_.sub( /regexp_(with)_multiple(.*)/ , "" ) ; > i = $1 ; > j = $2 ; > k = $3 ; > > But I don't like global variables. Ruby functions can return > everything.. > a = $stdin.readlines() > So isn't there somewhere > String.match( Regexp ) that returns Array of matches ? > > Hi Suk > # please cc me, i'm not on the list > > > > > > > >