fork(1) download
  1. import java.util.*;
  2. import java.lang.*;
  3. import java.io.*;
  4. import java.util.regex.*;
  5.  
  6. class Ideone
  7. {
  8. public static void main (String[] args) throws java.lang.Exception
  9. {
  10. // Adapted from Phsemo
  11. // http://stackoverflow.com/q/17892284/
  12. String subject = "0,123,45,6789,4,5,3,4,6000";
  13. String[] thesplits = subject.split("(?<=\\G\\d+,\\d+,\\d+),");
  14. for(String token : thesplits) System.out.println(token);
  15.  
  16. } // End main
  17. } // End Ideone
Success #stdin #stdout 0.07s 380160KB
stdin
Standard input is empty
stdout
0,123,45
6789,4,5
3,4,6000