From: David Alan Black Date: 2002-05-19T10:56:14+09:00 Subject: Re: Ruby regex question Hi -- On Sun, 19 May 2002, Dossy wrote: > On 2002.05.19, Michael Campbell wrote: > > I'm probably in the minority and I'm ok with that, but #match > > matching n things but returning n+1 values breaks MY worldview of > > "least astonishment". > > > > Then again, I've come from a perl background, so maybe my worldview > > needs adjusting. > > Well, what would be _cool_ is if the "if" worked like this: > > if matched, x, y = str.match /(.)(.)/ # boobies! sorry, couldn't resist > puts "we matched." > else > puts "we didn't match." > end > > Of course, matched would be an instance of either TrueClass or > FalseClass ... ;-) You want a method called #match that throws away the match? :-) David -- David Alan Black home: dblack@candle.superlink.net work: blackdav@shu.edu Web: http://pirate.shu.edu/~blackdav