Morris, Chris wrote:


> irb(main):008:0> "test/page".scan(/\//)
> ["/"]
> irb(main):009:0> "test\page".scan(/\\/)
> []
> 
> What am I doing wrong in the second statement that it's not returning the
> backslash?


irb(main):001:0> 'test\page'.scan /\\/
["\\"]
irb(main):002:0> "test\page".scan /\\/
[]
irb(main):003:0>

Inside "" s, the \ s get resolved (plus #{} s). Inside '', nothing gets resolved.


Tobi



-- 
Tobias Reif
http://www.pinkjuice.com/myDigitalProfile.xhtml

go_to('www.ruby-lang.org').get(ruby).play.create.have_fun
http://www.pinkjuice.com/ruby/