Stray thought: strlen() has to traverse the string looking for a '\0' byte, which strcspn already did for us.  We could make this test cheaper by writing it as: <code>
if (string[strcspn(string, "metachars")] == '\0') /* i.e. no metachars appear in string */
</code>