This allows "." but disallows "_", which doesn't match the docs.  (I'm still confused by why we are bothering to place any restrictions on this at all, though -- we don't bother for other things like command IDs, and we have no foreseeable need for these things to be valid filenames).