fork(2) download
  1. import java.util.regex.*;
  2. class Main {
  3. public static void main(String args[])
  4. {
  5. Pattern MY_PATTERN = Pattern.compile(".*(\\(\\d+\\))");
  6. Matcher mat = MY_PATTERN.matcher("Class (102) (401)");
  7. while (mat.find()){
  8. System.out.println("--"+mat.group(1));
  9. }
  10.  
  11. }
  12. }
  13.  
Success #stdin #stdout 0.07s 215552KB
stdin
Standard input is empty
stdout
--(401)