From: Phil Cooper-king Date: 2010-01-08T21:06:01+09:00 Subject: Re: Stopping String Escaping. thanks again yep I have the same gems and the same result running your code. I went nuts with the puts all over the place fromdb: "##code(ruby)\r\n'\\\\'\r\n##code\r\n" before: "##code(ruby)\n'\\\\'\n##code\n" before parse: "\n'\\\\'\n" after parse: "
\n'\\\\'\n
" after insert: "
\n'\\\\'\n
" after sub: "
\n'\\'\n
\n" so after the sub section I loose two of the back slashes [code] text.sub!(/##code\((\S+)\)(.+?)##code/m, code) [/code] -- Posted via http://www.ruby-forum.com/.