I want to extract all method calls from java code. I have written following two regular expression but they are not able to extract all the method calls.
Reg1 : Pattern.compile("([a-zA-Z][0-9_a-zA-Z]*\\([a-zA-Z0-9_\\s,\\[\\]\\(\\)\\.]+\\))");
Reg2 : Pattern.compile("([a-zA-Z][0-9_a-zA-Z]*\\([\\s]*\\))")
Input:
"{
     if ((war == null) && (config != null)) {
    sb.append( &config= );
    sb.append(URLEncoder.encode(config,getCharset()));
    }
    if ((war == null) && (localWar != null)) {
    sb.append( &war= );
    sb.append(URLEncoder.encode(localWar,getCharset()));
    }
    if (update) {
    sb.append( &update=true );
    }
    if (tag != null) {
      sb.append( &tag= );
      sb.append(URLEncoder.encode(tag,getCharset()));
     }
     }"
output:
getCharset getCharset getCharset append append append
I am not able to extract  "encode".
Does anyone have any idea as an what should I add to regular expression?
 
     
     
    