Match Class

Match Class

Represents the results from a single regular expression match.

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


[Visual Basic]
Public Class Match
   Inherits Group
public class Match : Group
public __gc class Match : public Group
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.


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.


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

© 2015 Microsoft