On Tue, Jul 08, 2003 at 02:52:44AM +0900, Michael Campbell wrote:
> > Jim Freeze <jim / freeze.org> writes:
> > > > Just remember, string goes on the left, regex goes on the right.
> > > >
> > >
> > > Actually, it doesn't matter, but Matz prefers the regex on the left.
> >
> > Heh.  Learn something new every day.
> 
> 
> I always wondered about that.  It "reads" funny to my brain that way but I
> wasn't consulted.  =D   Too, it's easy enough to do either direction, so no
> worries.

I think regex-on-right is a perlism, but even in Ruby if you use =~ on two
strings, it's the one on the right which is treated as a regex:

irb(main):003:0> "abc" =~ "b"
=> 1
irb(main):004:0> "b" =~ "abc"
=> nil

Cheers,

Brian.