i want to get class name from java file .for example
class Mango {
now i want to get mango
as class name.
this is the regex i used
\s*class\s+(\S+)
it works and i captured the class name .the problem is if clasname has no spaces between classname and closing curly bracket i get name as mango{
like below one.
class Mango{
so i want to exclude {
from group.so i modyfy to following
\s*class\s+(\S+|[^{])
but it doesn't work and still capture classname with closing bracket. how can i get only class name .