Group Class

Definition

Represents the results from a single capturing group.

public ref class Group : System::Text::RegularExpressions::Capture
public class Group : System.Text.RegularExpressions.Capture
[System.Serializable]
public class Group : System.Text.RegularExpressions.Capture
type Group = class
    inherit Capture
[<System.Serializable>]
type Group = class
    inherit Capture
Public Class Group
Inherits Capture
Inheritance
Group
Derived
Attributes

Remarks

A capturing group can capture zero, one, or more strings in a single match because of quantifiers. (For more information, see Quantifiers.) All the substrings matched by a single capturing group are available from the Captures property. Information about the last substring captured can be accessed directly from the Value and Index properties. (That is, the Group instance is equivalent to the last item of the collection returned by the Captures property, which reflects the last capture made by the capturing group.)

Properties

Name Description
Captures

Gets a collection of all the captures matched by the capturing group, in innermost-leftmost-first order (or innermost-rightmost-first order if the regular expression is modified with the RightToLeft option). The collection may have zero or more items.

Index

Gets the position in the original string where the first character of the captured substring is found.

(Inherited from Capture)
Length

Gets the length of the captured substring.

(Inherited from Capture)
Name

Returns the name of the capturing group represented by the current instance.

Success

Gets a value indicating whether the match is successful.

Value

Gets the captured substring from the input string.

(Inherited from Capture)
ValueSpan

Gets the captured span from the input string.

(Inherited from Capture)

Methods

Name Description
Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Synchronized(Group)

Returns a Group object equivalent to the one supplied that is safe to share between multiple threads.

ToString()

Retrieves the captured substring from the input string by calling the Value property.

(Inherited from Capture)

Applies to