I want to group some characters between special symbol bounds, but this bounds are involved into group. It is not connected with greedy and reluctant quantifier.
String str1 = "#162xd14a#";
Matcher matcher = Pattern.compile("#(.*?)#").matcher(str1);
if (matcher.matches()) {
for (int i = 0; i < matcher.groupCount(); i++) {
System.out.println(matcher.group(i));
}
}
Result:
#162xd14a#
But i expected:
162xd14a