relax the git and hg version-spec regexes so that #^1.2.3 is a valid version spec