From: dblack@... Date: 2002-11-09T22:26:08+09:00 Subject: Re: Lighting Rod Hi -- On Sat, 9 Nov 2002, Alan Chen wrote: > Now I'm curious, how many people use this: > > if( str =~ /pattern/) > # .. do stuff with $1, $2, et al.. > > versus this: > > if( m = /pattern/.match(str) ) > # do stuff with match obj. m I tend to use some variant of the latter. Usually it ends up looking like: m = re.match(str) if m puts "Your first name is #{m[1]}." else puts "You have no name...." end David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav