fork download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.util.regex.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. String s = "#DESTINATION: 71222222\n"+
  10. "#PRIORITY: urgent\n"+
  11. "#AUTRE: rien";
  12. Pattern p = Pattern.compile("(?<=: )[^ ]+$", Pattern.MULTILINE);
  13. Matcher m = p.matcher(s);
  14. while(m.find()) {
  15. System.out.println(m.group(0));
  16. }
  17.  
  18. }
  19. }
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
71222222
urgent
rien