From: Sylvain Joyeux Date: 2007-01-23T17:40:47+09:00 Subject: Re: Regular expression: Is this a bug or feature? > irb(main):001:0> s1='a=1' > => "a=1" > irb(main):003:0> s1 =~ /a|b=(.)/ > => 0 <------ expression matches > irb(main):004:0> $1 > => nil <------ but where is argument? You wanted to do s1 =~ /(?:a|b)=(.)/. The | operator has a low precedence in regexps -- Sylvain Joyeux