Handle `query-replace-from-to-separator' correctly

Hello,

In emacs 25 `query-replace-regexp` is enhanced, see http://endlessparentheses.com/new-in-emacs-25-1-query-replace-history-is-enhanced-.html

This fixes `pcre-mode` so it works properly with it.

I'm not sure the fix is "right" so please review/give some feedback before merging.