String#sub and character sequence \' in replacement string
I don't know if this is intentional but substitution of
\` in the replacement string was rather unexpected for me:
2.2.2 :001 > "this is a test".sub(/this/, "some text \\'") => "some text is a test is a test"
I would have expected the following result:
=> "some text \\' is a test"
The documentation says nothing about this, just that back-references can be used (i.e.
A work-around is escaping the escape character:
2.2.2 :001 > "this is a test".sub(/this/, "some text \\\\'") => "some text \\' is a test"