Regex.GetGroupNames Method ()
Returns an array of capturing group names for the regular expression.
Assembly: System (in System.dll)
The collection of group names contains the set of strings used to name capturing groups in the expression. Even if capturing groups are not explicitly named, they are automatically assigned numerical names ("0", "1", "2", "3", and so on). The "0" named group represents all text matched by the regular expression pattern. Numbered groups precede explicitly named groups in the collection, and named groups appear in the order in which they are defined in the regular expression pattern.
You can use the Length property on the array returned by this method to determine the number of groups in a regular expression.
Available since 8
Available since 1.1
Portable Class Library
Supported in: portable .NET platforms
Available since 2.0
Windows Phone Silverlight
Available since 7.0
Available since 8.1