improved regex for Java classes and allowed packages to contain the underscore character