I'm having trouble figuring out valid Java package names using Python. Here is the code:
packageName = "com.domain.lala"
matchObject = re.match("([a-z_]{1}[a-z0-9_]*(\.[a-z_]{1}[a-z0-9_]*)*)",
packageName)
if matchObject is not None:
print packageName + " is a package name!"
else:
print packageName + " is *not* a package name!"
Utilities.show_error("Invalid Package Name", "Invalid package name " + packageName + "!", "Ok", "", "")
Package names must begin with a lowercase letter or underscore, and each dot must be accompanied by at least one lowercase letter or underscore. All other characters can be lowercase, numbers, or underscores. No jogging is allowed and may not end or start from a point.
How to solve this?
source
share