The logic in this section is very confusing. It seems like it's matching against a regex that can fail to match in several different ways, then it's trying to infer the way it failed by checking the ways in which it *didn't* fail. Wouldn't it make more sense to just explicitly check whether the namespace contains non-alphanumeric characters, instead of checking that the module name is okay and thereby inferring it was the namespace that had the problem?