given: Pattern pattern = Pattern.compile("(?<digit>\\d)(\\w)"); Matcher matcher = pattern.matcher("2foo3bar4"); when matcher.namedGroups(); then Only the first group is being found due to reseting of matcher.