public static IEnumerable<Capture> GroupCaptures(this Match match, string groupName) { var group = match.Groups[groupName]; for (int i = 0; i < group.Captures.Count; i++) { yield return group.Captures[i]; } } }