From: 7stud -- Date: 2009-02-20T09:27:53+09:00 Subject: Re: Ruby RE expression anomaly. RichardOnRails wrote: > 1) My tests show that you need 10 backslashes in the substitution to get 3 in the final result. line = "HREF=" line.sub!(/(HREF=)/, '\1file:\\\\\\\\\\') p line puts line --output:-- "HREF=file:\\\\\\" HREF=file:\\\ 10 backslashes in sub ----------------------- = 3.3 backslashes per desired backslash. lol. 3 backslashes in final result -- Posted via http://www.ruby-forum.com/.