A regex that matches the current buffer's extension should only match at
the end.
Escape PCRE metacharacters in the file extension.