Only replace special search terms when they're a standalone word

Otherwise we run the risk of badly munging typo'd queries like
"test::dist:manifest" into something stranger.

Note that the character class for distribution names had to change to
include hyphens since the end is now anchored.