Using java.util.regex
(jdk 1.6), the regular expression 201210(\\d{5,5})Test
applied to the subject string 20121000002Test
only captures <
the regular expression "201210(\d{5,5})Test" applied to the subject string "20121000002Test" only captures group(0) and does not capture group(1)
Well I can say I didn't read the manual either but if you do it says for Matcher.groupCount()
Returns the number of capturing groups in this matcher's pattern. Group zero denotes the entire pattern by convention. It is not included in this count.