Fix #394.  Handle search strings that end in backslashes.  Also, if
regexsearch is enabled, print error message when regex is invalid.