Name
GroupCollection
Synopsis
This class is a collection of the captured groups in a regular expression.
A GroupCollection
is indexed by either
a string with the name of the capture group, or with an integer number of the capture group as determined
in the regular expression (give a name to a capture group by putting ?<name>
immediately after the opening
parenthesis). So, Match.Groups
("name")
would
retrieve a capture from the subexpression (?<name>expr)
,
and Match.Groups
(1)
would be
the result from the first explicitly grouped subexpression. The entire regular expression is
the zero-indexed group (an expression without any groupings is treated as a single
group). A GroupCollection
is returned by Match.Groups
.
Public Class GroupCollection : Implements ICollection, IEnumerable ' Public Instance Properties Public ReadOnly Property Count As Integer Implements ICollection.Count Public ReadOnly Property IsReadOnly As Boolean Public ReadOnly Property IsSynchronized As Boolean Implements ICollection.IsSynchronized Public Default ReadOnly Property Item( ByVal groupnum As Integer) As Group Public Default ReadOnly Property Item( ByVal groupname As String) As Group Public ReadOnly Property SyncRoot As Object Implements ICollection.SyncRoot ' Public Instance Methods Public Sub CopyTo(ByVal array As Array, ByVal arrayIndex As Integer) Implements ICollection.CopyTo Public Function GetEnumerator( ) As IEnumerator Implements IEnumerable.GetEnumerator End Class
Returned By
Match.Groups
Get VB.NET Core Classes in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.