Java
Version vom 19. April 2016, 13:40 Uhr von Hamatoma (Diskussion | Beiträge)
Resource aus Jar lesen
InputReader input = getClass().getResourceAsStream("appl.properties"); BufferedReader reader = new BufferedReader(new InputStreamReader(input)); String line; while( (line = reader.readLine()) != null) doIt(line);
Reguläre Ausdrücke
Pattern rexpr = Pattern.compile("Name: (\\w+)"); Matcher matcher; while( (line = reader.readLine()) != null){ if ( (matcher = rexpr.matcher(line)).find()){ name = matcher.group(1); } }