I need to find the occurrence of a string function call, but I need to include the case where there is more than one passed parameter, such as:
Tower.getType(i,j).initialPrice(f,g);
So far I have only been able to formulate the regex when there is only one parameter:
[\w]+([\.]+[\w]+[(]+[\w]*+[)]){2,}+[;]
The code snippet:
public static void verificaMessageChain (String s) {
if (s!=null && s.matches("[\w]+([\.]+[\w]+[(]+[\w]*+[)]){2,}+[;]")) {
System.out.println("\nÉ Message Chain para "+s+"\n");
splitMessageChain(s); // {0,} equivale a *
} else if (s!=null && s.matches("[\w] + ([\.] + [\w] + [(] + [\w]* + ([\,] + [\w])* + [)]) {2,} + [;]")) {
System.out.println("\nÉ Message Chain para "+s+"\n");
splitMessageChain(s);
} else {
System.out.println("\nNão é Message Chain para "+s+"\n");
}
}