/* package whatever; // don't place package name! */

import java.util.*;
import java.util.regex.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone {
	public static void main (String[] args) throws java.lang.Exception {
        String test= "ytrt.ytrwyt.ytreytre.test1,0,2,0"
                    +"sfgtr.ytyer.qdfre.uyeyrt.test2,0,8,0"
                    +"sfgtr.ytyer.qdfre.uyeyrt.test3,0,3,0";
        String pattern = "(?<=test[123],[^,],)\\d+";

        Pattern pr = Pattern.compile(pattern);

        Matcher match = pr.matcher(test);
        System.out.println();
        while (match.find()) {
            System.out.println("Found: " + match.group());
        }
	}
}
