System.Text.RegularExpressions.Group�Class

Assembly: System.dll
Namespace: System.Text.RegularExpressions
Summary
Group represents the results from a single capturing group. A capturing group can capture zero, one, or more strings in a single match because of quantifiers, so Group supplies a collection of Capture objects.
C# Syntax:
[Serializable]
public class Group : Capture
Remarks
Group inherits from Capture so the last substring captured can be accessed directly. (That is, the Group instance itself is equivalent to the last item of the collection returned by the Group.Captures property).
See also:
System.Text.RegularExpressions Namespace

System.Text.RegularExpressions.Group Member List:

Public�Properties
Captures Read-only

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 RegexOptions.RightToLeft option). The collection may have zero or more items.
Index
(inherited from�System.Text.RegularExpressions.Capture)
Read-only

See base class member description: System.Text.RegularExpressions.Capture.Index


The position in the original string where the first character of the captured substring was found.
Length
(inherited from�System.Text.RegularExpressions.Capture)
Read-only

See base class member description: System.Text.RegularExpressions.Capture.Length


The length of the captured substring.
Success Read-only

Gets a value indicating whether the match is successful.
Value
(inherited from�System.Text.RegularExpressions.Capture)
Read-only

See base class member description: System.Text.RegularExpressions.Capture.Value


Gets the captured substring from the input string.
Public�Methods
Equals
(inherited from�System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from�System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from�System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
Synchronized Returns a Group object equivalent to the one supplied that is safe to share between multiple threads.
ToString
(inherited from�System.Text.RegularExpressions.Capture)
See base class member description: System.Text.RegularExpressions.Capture.ToString


Gets the captured substring from the input string.
Protected�Methods
Finalize
(inherited from�System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from�System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.Text.RegularExpressions.Group Member Details

Property: Captures (read-only)
Summary
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 RegexOptions.RightToLeft option). The collection may have zero or more items.
C# Syntax:
public CaptureCollection�Captures {get;}

Return to top


Property: Index (read-only)
Inherited
See base class member description: System.Text.RegularExpressions.Capture.Index

Summary
The position in the original string where the first character of the captured substring was found.
C# Syntax:
public int�Index {get;}

Return to top


Property: Length (read-only)
Inherited
See base class member description: System.Text.RegularExpressions.Capture.Length

Summary
The length of the captured substring.
C# Syntax:
public int�Length {get;}

Return to top


Property: Success (read-only)
Summary
Gets a value indicating whether the match is successful.
C# Syntax:
public bool�Success {get;}
Remarks
The Success property is true if at least one substring was captured by this group. It is equivalent to the Boolean expression (Group.Captures.Count > 0).

Return to top


Property: Value (read-only)
Inherited
See base class member description: System.Text.RegularExpressions.Capture.Value

Summary
Gets the captured substring from the input string.
C# Syntax:
public string�Value {get;}

Return to top


Method: Equals(
���objectobj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool�Equals(
���objectobj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~Group();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int�GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type�GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object�MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Synchronized(
���Groupinner
)
Summary
Returns a Group object equivalent to the one supplied that is safe to share between multiple threads.
C# Syntax:
public static Group�Synchronized(
���Groupinner
);
Parameters:

inner

The input Group object.

Return Value:
A regular expression Group object.

Return to top


Method: ToString()
Inherited
See base class member description: System.Text.RegularExpressions.Capture.ToString

Summary
Gets the captured substring from the input string.
C# Syntax:
public override string�ToString();
Return Value:
The actual substring that was captured by the match.
Remarks
ToString is actually an internal call to Capture.Value.

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.