import java.util.*;
import java.util.regex.*;


class rTest {
  public static void main (String[] args) {

String test = "int measure; \n" +
              "void introduce() { \n" +
              "while (line != null) { \n" +
              "if(measure > 0) { \n" +
              "System.out.println(smile); \n" +
                "} \n" +
              "}";  

String functions = "(?mi)^(?:(?!(?:catch|if|while|try|return|finally|new|throw)).)*$";
Pattern patternFunctions = Pattern.compile(functions);
Matcher matcherFunctions = patternFunctions.matcher(test);
while(matcherFunctions.find()) 
          System.out.println(matcherFunctions.group());

  }
}