From: Jeff Wood Date: 2005-11-27T09:51:00+09:00 Subject: Re: String#to_rx ? I didn't want them to be ... I wanted the body of the string to be passed in literally ... Yes, I understand if I wanted otherwise I would have to do just a touch more work... c = /#{ Regexp.escape( b ) }/ but, it's all literal, and doesn't surprise me... as it shouldn't anyone else. /#{ b }/ where b = "w.*" should be /w.*/ ... guess I'm not understanding the original point ... somebody wanting an additional wrapper for strings that auto escapes them ? why not write one %e( ) or something like that. ... j. On 11/26/05, Trans wrote: > Jeff, > > a = "hello world" > b = "w.*" > c = /#{ b }/ > c.match( a ).to_a > #=> ["world"] > > Characters arn't escaped. > > T. > > > -- "Remember. Understand. Believe. Yield! -> http://ruby-lang.org" Jeff Wood