Escape characters when converting strings into search regexps