I am not able to split the string for every 1000th comma in a string using regular expression. We are able to split for every 3rd comma in string but not for 1000th comma.
String data = "0,0,1,2,4,5,3,4,6......";
String[] array = data.split("(?<=\\G\\d+,\\d+,\\d+),"); //Magic :)
// to reveal magic see explanation below answer
for(String s : array){
System.out.println(s);
}
Thanks in advance for your suggestions.