Method regexp.GetMaxGroupNumber Overload Returns the highest capture group number in the regular expression. If (?| not used, this is also the total count of capture groups. public int GetMaxGroupNumber() Returns int