Fix search/replace of strings containing backslashes

Hello

This is a small patch that fixes the search/replace functionality for strings
such as "\", "\\", "\n", "\r", "qwerty\n" etc. It's kind of a subtle fix, but I've
taken the time to test it and this would be useful for people (like me) who
use this text editor to do C programming.

(I think I'll probably have to send it to gedit too)