This documentation is archived and is not being maintained.

MatchAttribute Constructor

Initializes a new instance of the MatchAttribute class with the specified pattern.

[Visual Basic]
Public Sub New( _
   ByVal pattern As String _
)
[C#]
public MatchAttribute(
   string pattern
);
[C++]
public: MatchAttribute(
   String* pattern
);
[JScript]
public function MatchAttribute(
   pattern : String
);

Parameters

pattern
A string that represents the pattern to match.

Remarks

Use this constructor to create and initialize a new instance of the MatchAttribute class using the specified pattern.

The following table shows the initial property value for an instance of MatchAttribute.

Property Initial Value
Pattern The value of the pattern parameter.

Example

[Visual Basic] 
[C#] 
[C++] 
public __gc class Example_Headers {
public:
   [MatchAttribute(S"TITLE>(.?)<")]
   String* Title;

   [MatchAttribute(S"", Pattern=S"h1>(.?)<", IgnoreCase=true)]
   String* H1;

   [MatchAttribute(S"H2>(((->Item[^<, ]*), ?)+)<", Group=3, Capture=4)]
   String* Element;

   [MatchAttribute(S"H2>(((->Item[^<, ]*), ?) {2, })<", Group=3, MaxRepeats=0)]
   String* Elements1[];

   [MatchAttribute(S"H2>(((->Item[^<, ]*), ?) {2, })<", Group=3, MaxRepeats=1)]
   String* Elements2[];

   [MatchAttribute(S"H3 (->Item[^=]*)=(->Item[^>]*)", Group=1)]
   String* Attribute;

   [MatchAttribute(S"H3 (->Item[^=]*)=(->Item[^>]*)", Group=2)]
   String* Value;
};

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.

Requirements

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

See Also

MatchAttribute Class | MatchAttribute Members | System.Web.Services.Protocols Namespace

Show: