MatchAttribute.MaxRepeats プロパティとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > MatchAttribute.MaxRepeats プロパティの意味・解説 

MatchAttribute.MaxRepeats プロパティ

一致した値を返す個数について、その最大個数取得または設定します

名前空間: System.Web.Services.Protocols
アセンブリ: System.Web.Services (system.web.services.dll 内)
構文構文

Dim instance As MatchAttribute
Dim value As Integer

value = instance.MaxRepeats

instance.MaxRepeats = value
public int MaxRepeats { get;
 set; }
public:
property int MaxRepeats {
    int get ();
    void set (int value);
}
/** @property */
public int get_MaxRepeats ()

/** @property */
public void set_MaxRepeats (int
 value)
public function get MaxRepeats
 () : int

public function set MaxRepeats
 (value : int)

プロパティ
一致した値を返す個数の、最大個数既定値は -1 で、すべての値を返します

解説解説

1 を指定すると、最初一致だけを返します。-1 を指定すると、すべての一致返します。-1 という値は、正規表現の「*」と同じです。

使用例使用例
Public Class Headers

    <MatchAttribute("TITLE>(.*?)<")> _
    Public Title As String

    <MatchAttribute("", Pattern:="h1>(.*?)<",
 IgnoreCase:=True)> _
    Public H1 As String

    <MatchAttribute("H2>((([^<,]*),?)+)<",
 Group:=3, Capture:=4)> _
    Public Element As String

    <MatchAttribute("H2>((([^<,]*),?){2,})<",
 Group:=3, MaxRepeats:=0)> _
    Public Elements1() As String

    <MatchAttribute("H2>((([^<,]*),?){2,})<",
 Group:=3, MaxRepeats:=1)> _
    Public Elements2() As String

    <MatchAttribute("H3 ([^=]*)=([^>]*)", Group:=1)>
 _
    Public Attribute As String

    <MatchAttribute("H3 ([^=]*)=([^>]*)", Group:=2)>
 _
    Public Value As String
End Class 'Headers
public class Example_Headers 
{    
    [MatchAttribute("TITLE>(.*?)<")]
    public string Title;
        
    [MatchAttribute("", Pattern="h1>(.*?)<", IgnoreCase=true)]
    public string H1;

    [MatchAttribute("H2>((([^<,]*),?)+)<", Group=3, Capture=4)]
 
    public string Element;

    [MatchAttribute("H2>((([^<,]*),?){2,})<", Group=3, MaxRepeats=0)]
 
    public string[] Elements1;

    [MatchAttribute("H2>((([^<,]*),?){2,})<", Group=3, MaxRepeats=1)]
 
    public string[] Elements2;

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

    [MatchAttribute("H3 ([^=]*)=([^>]*)", Group=2)]
    public string Value;
}
public ref class Example_Headers
{
public:

   [MatchAttribute("TITLE>(.*?)<")]
   String^ Title;

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

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

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

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

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

   [MatchAttribute("H3 ([^=]*)=([^>]*)",Group=2)]
   String^ Value;
};
public class Example_Headers
{
    /** @attribute MatchAttribute("TITLE>(.*?)<")
     */
    public String title;

    /** @attribute MatchAttribute("", Pattern = "h1>(.*?)<",
 IgnoreCase = true)
     */
    public String h1;

    /** @attribute MatchAttribute("H2>((([^<,]*),?)+)<", Group
 = 3, Capture = 4)
     */
    public String element;

    /** @attribute MatchAttribute("H2>((([^<,]*),?){2,})<", Group
 = 3, 
        MaxRepeats = 0)
     */
    public String elements1[];

    /** @attribute MatchAttribute("H2>((([^<,]*),?){2,})<", Group
 = 3, 
        MaxRepeats = 1)
     */
    public String elements2[];

    /** @attribute MatchAttribute("H3 ([^=]*)=([^>]*)", Group = 1)
     */
    public String attribute;

    /** @attribute MatchAttribute("H3 ([^=]*)=([^>]*)", Group = 2)
     */
    public String value;
} //Example_Headers
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
MatchAttribute クラス
MatchAttribute メンバ
System.Web.Services.Protocols 名前空間



英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

MatchAttribute.MaxRepeats プロパティのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



MatchAttribute.MaxRepeats プロパティのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2025 Microsoft.All rights reserved.

©2025 GRAS Group, Inc.RSS