To develop a Java Code parser, I want to extract the contents of a method from java source file as strings. But the problem is that I can not compare the contents of the Regex, giving a number between {and }because some of the techniques are {and }inside the method. Like this,
public String[] getArgs() {
try{
}
catch(Exception e){
}
return args;
}
If I use regex like
Regex regex = new Regex("(?<={).*?(?=})");
He only captures try{ //something
How can I ignore the occurrences of a method {both }inside and get the value inside the method, e.g.
try{
}
catch(Exception e){
}
return args;
source
share