Add pre-check function for range matcher

This adds a pre-check function for the range matcher, fixing a KeyError
when one attempts to use the range matcher without the required module
being installed.

Resolves #9236.