Regex.GroupNameFromNumber(Int32) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets the group name that corresponds to the specified group number.
public:
System::String ^ GroupNameFromNumber(int i);
public string GroupNameFromNumber(int i);
member this.GroupNameFromNumber : int -> string
Public Function GroupNameFromNumber (i As Integer) As String
Parameters
- i
- Int32
The group number to convert to the corresponding group name.
Returns
A string that contains the group name associated with the specified group number. If there is no group name that corresponds to the specified group number, the method returns Empty.
Remarks
A regular expression pattern may contain either named or numbered capturing groups. Numbered groups are delimited by the syntax (subexpression) and are assigned numbers based on their order in the regular expression. Named groups are delimited by the syntax (?<name>subexpression). The GroupNameFromNumber(Int32) method identifies both named groups and numbered groups by their ordinal positions in the regular expression.