Interesting. Not what I expected. This is Ruby 1.8.6.> irbirb(main):001:0> str = "abx\bc" => "abx\bc" irb(main):002:0> str.length => 5 irb(main):003:0> s = str.sub(/.\b/, '''') => "ab\bc" irb(main):004:0> s.length => 4 irb(main):005:0> s = str.sub(/.\x08/, '''') => "abc" irb(main):006:0> s.length => 3 irb(main):007:0> Backspace character representation in ASCII, UTF-8, etc. is 8. Jeffrey --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On Apr 15, 4:13 pm, "Jeffrey L. Taylor" <r...-f/t7CGFWhwGcvWdFBKKxig@public.gmane.org> wrote:> Interesting. Not what I expected. This is Ruby 1.8.6. >Inside a rexexp, \b is not a backspace (except in a character class). it means word boundary. Fred> > irb > > irb(main):001:0> str = "abx\bc" > => "abx\bc" > irb(main):002:0> str.length > => 5 > irb(main):003:0> s = str.sub(/.\b/, '''') > => "ab\bc" > irb(main):004:0> s.length > => 4 > irb(main):005:0> s = str.sub(/.\x08/, '''') > => "abc" > irb(main):006:0> s.length > => 3 > irb(main):007:0> > > Backspace character representation in ASCII, UTF-8, etc. is 8. > > Jeffrey--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Jeffrey L. Taylor wrote:> Interesting. Not what I expected. This is Ruby 1.8.6.ask ruby talk or core? -=r -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---