determine completion word regexp based on snippets

same logic that the snippets package itself exercises

this fixes snippets that have special characters in their name (i.e.
unicode); previously the completion would only replace a piece of the
prefix with the snippet