corrected regex for a Java class and added regex for a Java method