MatchAttribute Class


Represents the attributes of a match made using text pattern matching. This class cannot be inherited.

Namespace:   System.Web.Services.Protocols
Assembly:  System.Web.Services (in System.Web.Services.dll)


public ref class MatchAttribute sealed : Attribute


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


Gets or sets a value that represents the index of a match within a grouping.


Gets or sets a value that represents a grouping of related matches.


Gets or sets a value that indicates whether the pattern to match is case insensitive.


Gets or sets the maximum number of values to return from the match.


Gets or sets a regular expression that represents the pattern to match.


When implemented in a derived class, gets a unique identifier for this Attribute.(Inherited from Attribute.)


This API supports the product infrastructure and is not intended to be used directly from your code. Returns a value that indicates whether this instance is equal to a specified object.(Inherited from Attribute.)


Returns the hash code for this instance.(Inherited from Attribute.)


Gets the Type of the current instance.(Inherited from Object.)


When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class.(Inherited from Attribute.)


When overridden in a derived class, returns a value that indicates whether this instance equals a specified object.(Inherited from Attribute.)


Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Attribute::GetIDsOfNames(Guid%, IntPtr, UInt32, UInt32, IntPtr)

Maps a set of names to a corresponding set of dispatch identifiers.(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Attribute::GetTypeInfo(UInt32, UInt32, IntPtr)

Retrieves the type information for an object, which can be used to get the type information for an interface.(Inherited from Attribute.)


Retrieves the number of type information interfaces that an object provides (either 0 or 1).(Inherited from Attribute.)

System_CAPS_pubinterfaceSystem_CAPS_privmethod_Attribute::Invoke(UInt32, Guid%, UInt32, Int16, IntPtr, IntPtr, IntPtr, IntPtr)

Provides access to properties and methods exposed by an object.(Inherited from Attribute.)

Text pattern matching allows an XML Web service to leverage existing HTML content by parsing it using regular expressions. an XML Web service specifies the content it wants to parse in a Service Description using match elements. These match elements specify several items: the regular expression for parsing the contents of an existing HTML page, whether the parsing must be case-insensitive, and how many instances of content that matches the regular expression should be returned. When a client builds a proxy class using the Wsdl.exe tool, methods of the proxy class include a MatchAttribute detailing the match elements found in the Service Description.

For more information on text pattern matching, see [<topic://cpconcreatingclientsthatparsecontentofotherwebpages>].

#using <System.dll>
#using <System.Web.Services.dll>

using namespace System;
using namespace System::Web::Services::Protocols;

public ref class Example_Headers

   String^ Title;

   String^ H1;

   String^ Element;

   array<String^>^ Elements1;

   array<String^>^ Elements2;

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

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

public ref class MatchAttribute_Example: public HttpGetClientProtocol
      Url = "http://localhost";

   Example_Headers^ GetHeaders()
      return ((Example_Headers^)(Invoke( "GetHeaders", ( Url + "/MyHeaders.html" ),
         gcnew array<Object^>(0) )));

   System::IAsyncResult^ BeginGetHeaders( System::AsyncCallback^ callback,
      Object^ asyncState )
      return BeginInvoke( "GetHeaders", ( Url + "/MyHeaders.html" ),
         gcnew array<Object^>(0), callback, asyncState );

   Example_Headers^ EndGetHeaders( System::IAsyncResult^ asyncResult )
      return (Example_Headers^)(EndInvoke( asyncResult ));

.NET Framework
Available since 1.1

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

Return to top