Freigeben über


MatchAttribute.Pattern-Eigenschaft

Ruft einen regulären Ausdruck ab, der das Vergleichsmuster darstellt, oder legt diesen fest.

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

Syntax

'Declaration
Public Property Pattern As String
'Usage
Dim instance As MatchAttribute
Dim value As String

value = instance.Pattern

instance.Pattern = value
public string Pattern { get; set; }
public:
property String^ Pattern {
    String^ get ();
    void set (String^ value);
}
/** @property */
public String get_Pattern ()

/** @property */
public void set_Pattern (String value)
public function get Pattern () : String

public function set Pattern (value : String)

Eigenschaftenwert

Ein regulärer Ausdruck, der das Vergleichsmuster darstellt.

Hinweise

Mit der Pattern-Eigenschaft können Sie den regulären Ausdruck angeben, der den Vergleichswert darstellt.

Beispiel

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

Plattformen

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

.NET Framework unterstützt nicht alle Versionen sämtlicher Plattformen. Eine Liste der unterstützten Versionen finden Sie unter Systemanforderungen.

Versionsinformationen

.NET Framework

Unterstützt in: 2.0, 1.1, 1.0

Siehe auch

Referenz

MatchAttribute-Klasse
MatchAttribute-Member
System.Web.Services.Protocols-Namespace