MatchAttribute::MaxRepeats Property

 

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

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

public:
property int MaxRepeats {
	int get();
	void set(int value);
}

Property Value

Type: System::Int32

The maximum number of values to return from the match. The default value is -1, which refers to returning all values.

A value of 1 returns only the first match. A value of -1 returns all matches. Additionally, a value of -1 equates to an '*' in a regular expression.

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;
};

.NET Framework
Available since 1.1
Return to top
Show: