I am trying to write a Regex pattern to find java collections declarations. Example: i want to match below lines
private List<String> test;
private HashMap<String, HashMap<String, String>> test1;
I am trying the Pattern
(private|public|protected) [A-Za-z]{1,}<([A-Za-z]* *\W*[A-Za-z]\W*)> *[A-za-z]*;