fork(8) download
  1. import java.util.*;
  2. import java.util.regex.*;
  3. import java.lang.*;
  4.  
  5. class Main
  6. {
  7. public static void main (String[] args) throws java.lang.Exception
  8. {
  9. Pattern p = Pattern.compile("[,. ]+");
  10. long start = System.currentTimeMillis();
  11.  
  12. for (int i=0; i<300000; i++)
  13. {
  14. String a = p.matcher(" 54,303,14311.34320 320,3254 ").replaceAll("");
  15. }
  16.  
  17. long end = System.currentTimeMillis();
  18.  
  19. System.out.println(end-start);
  20.  
  21. }
  22. }
Success #stdin #stdout 1.24s 213568KB
stdin
Standard input is empty
stdout
1211