I am studying regular expression groups and have a simple question about that. Let's say I have a basic regular expression in java such as :
Pattern pattern = Pattern.compile("[0-9]{16}");
And I have a matcher :
Matcher matcher = pattern.matcher("111111111111111122);
while (matcher.find()) {
System.out.println(matcher.group());
}
When I loop, I want to be printed :
1111111111111111
1111111111111112
1111111111111122
I want to get the result of all 16 length number combinations. But it's only printed :
1111111111111111
Can I solve this issue by only modifying the regexp pattern?