F
Fabian Streitel
[Note: parts of this message were removed to make it a legal post.]
hi,
trying to solve someones mailinglist posted problem, I just created my own.
Why do 2 backslashes produce the same result as 4 and 6 the same as 8?
014:0> 'ab'.gsub('a', '\\')
=> "\\b"
015:0> 'ab'.gsub('a', '\\\\')
=> "\\b"
016:0> 'ab'.gsub('a', '\\\\\\')
=> "\\\\b"
017:0> 'ab'.gsub('a', '\\\\\\\\')
=> "\\\\b"
018:0> RUBY_DESCRIPTION
=> "ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]"
Doesn't that strike anyone as odd?
Greetz!
hi,
trying to solve someones mailinglist posted problem, I just created my own.
Why do 2 backslashes produce the same result as 4 and 6 the same as 8?
014:0> 'ab'.gsub('a', '\\')
=> "\\b"
015:0> 'ab'.gsub('a', '\\\\')
=> "\\b"
016:0> 'ab'.gsub('a', '\\\\\\')
=> "\\\\b"
017:0> 'ab'.gsub('a', '\\\\\\\\')
=> "\\\\b"
018:0> RUBY_DESCRIPTION
=> "ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-linux]"
Doesn't that strike anyone as odd?
Greetz!