import java.io.*;
import java.util.regex.*;
public class test
{
    public static void main(String[] args)
    {
String str = "12345";
        String regex="\\d\\d\\d"; 
        Matcher m=Pattern.compile(regex).matcher(str);
       while(m.find()){
count++;
            System.out.println(m.group());
System.out.println(count);
            
        }
System.out.println(count);
    }
    private static int count;
}
为何打印出来是
123
1
1
而不是
123
1
234
2
345
3
3
???求教