Modified validator to support multiple hyphens in package name