次の方法で共有


MatchAttribute コンストラクタ

パターンを指定して、 MatchAttribute クラスの新しいインスタンスを初期化します。

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

パラメータ

  • pattern
    一致させるパターンを表す文字列。

解説

このコンストラクタを使用して、指定したパターンで MatchAttribute クラスの新しいインスタンスを作成し、初期化します。

MatchAttribute のインスタンスの初期プロパティ値を次の表に示します。

プロパティ 初期値
Pattern pattern パラメータの値。

使用例

 
[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] JScript のサンプルはありません。Visual Basic、C#、および C++ のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン 言語のフィルタ をクリックします。

必要条件

プラットフォーム: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 ファミリ

参照

MatchAttribute クラス | MatchAttribute メンバ | System.Web.Services.Protocols 名前空間