Today at 10:11pm, Morris, Chris said:

> ruby 1.6.3 (2001-03-19) [i386-cygwin]
>
> 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?


I'm not quite sure, but I think between "" a \ should always be escaped.

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

irb(main):009:0> print "test\\page"
test\pagenil


grtz, wilbert

-- 
Wilbert Berendsen (http://www.xs4all.nl/~wbsoft/)

"To build an apple pie from scratch, you must first invent the universe."
Carl Sagan, Cosmos