From: Max Williams Date: 2008-11-13T21:52:33+09:00 Subject: Re: '#' characters are breaking my regexp Michael Libby wrote: > On Thu, Nov 13, 2008 at 5:21 AM, Max Williams > wrote: >> it thinking that the part after the first hash is a comment for example? > The # must be confusing the parser into thinking some #{} style > interpolation is going to happen. > > Substitute \# for # and see if that helps. Either way works the same > for me in 1.8.7. > > -Michael Libby I tried that already, no joy :( >> string = "abc#def" => "abc#def" >> /#{string}/ => abc >> string = "abc\#def" => "abc#def" >> /#{string}/ => abc >> Regexp.new(string) => abc -- Posted via http://www.ruby-forum.com/.