From: 7stud -- Date: 2012-09-01T04:45:21+09:00 Subject: Re: Can someone explain this string substitution issue to me? Because an escape, e.g. \x in a replacement string is a backreference. After ruby evaluates your string to produce \+, the regex engine sees \+ in a replacement string, which is the syntax for referring to a matching subgroup. In your case, \+ is especially tricky because it refers to the global variable $+, which is the last match from a previous regexp match--which is blank in your case. -- Posted via http://www.ruby-forum.com/.