Martin Kahlert wrote: > irb(main):003:0> s1 =~ /a|b=(.)/ > => 0 <------ expression matches > irb(main):004:0> $1 > => nil <------ but where is argument? I assume this is the one you need explanation for? I think you simply misinterpret the regexp. /a|b=(.)/ is a union between the two regexp /a/ and /b=(.)/. So in this case it matches only the first one which has no bindings. The regexp you are probably looking for would be /(?:a|b)=(.)/. Try that. -- Posted via http://www.ruby-forum.com/.