Separate package name regex
Problem
The package_name_regex is too long and complicated to be able to change and is trying to cover too many rules imposed by multiple package systems. Currently although this regex will stop invalid and malicious characters, it will allow packages that are valid for one type of package manager to be named using the conventions of another.
For example: an NPM package could be named "foo/bar", which should only be valid for Maven. A Maven package could be named "@foo/bar", which should only be valid for NPM. This extends to the newest Conan package manager as well, where this issue was first identified.
Solution
Create a generic package_name_regex that is purely for checking malicious intent, then use package-specific regexes such as maven_package_name_regex, npm_package_name_regex, conan_package_name_regex... to validate for each package type.