fork(10) download
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main
{
    public static void main(String a[]){
        String stream = "ab34ef";
        Pattern pattern = Pattern.compile("\\d*");

        //HERE * IS GREEDY QUANTIFIER THAT LOOKS FOR ZERO TO MANY COMBINATION THAT 
        //START WITH NUMBER 
        Matcher matcher = pattern.matcher(stream);

        while(matcher.find()){
            System.out.println(matcher.start()+ ": " + matcher.group());
        }
    }
}
Success #stdin #stdout 0.03s 245632KB
stdin
Standard input is empty
stdout
0: 
1: 
2: 34
4: 
5: 
6: