Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

Match Class

Represents the results from a single regular expression match.

For a list of all members of this type, see Match Members.

System.Object
   System.Text.RegularExpressions.Capture
      System.Text.RegularExpressions.Group
         System.Text.RegularExpressions.Match

[Visual Basic]
<Serializable>
Public Class Match
   Inherits Group
[C#]
[Serializable]
public class Match : Group
[C++]
[Serializable]
public __gc class Match : public Group
[JScript]
public
   Serializable
class Match extends Group

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Remarks

Because a single match can involve multiple capturing groups, Match has a Groups property that returns the GroupCollection. The GroupCollection has accessors that return each group. Match inherits from Group so the entire substring matched can be accessed directly. That is, the Match instance itself is equivalent to Match.Groups[0] (Match.Groups(0) in Visual Basic) . The Match object is immutable and has no public constructor.

Requirements

Namespace: System.Text.RegularExpressions

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, .NET Compact Framework

Assembly: System (in System.dll)

See Also

Match Members | System.Text.RegularExpressions Namespace

Show:
© 2017 Microsoft