Use raw strings
Fix generic character replacement

When a backslash is prepended to a character, that character is going
be preserved but the backslash should be removed.