Share via


RegexStringValidatorAttribute.Regex Özellik

Tanım

Normal ifade doğrulaması gerçekleştirmek için kullanılan dizeyi alır.

public:
 property System::String ^ Regex { System::String ^ get(); };
public string Regex { get; }
member this.Regex : string
Public ReadOnly Property Regex As String

Özellik Değeri

Süslü configuration-element özelliğine atanan dizeyi filtrelemek için kullanılan normal ifadeyi içeren dize.

Örnekler

Aşağıdaki örnekte özelliğinin nasıl kullanılacağı gösterilmektedir Regex .


ConfigurationValidatorBase valBase;

RegexStringValidatorAttribute rstrValAttr =
new RegexStringValidatorAttribute(@"\w+\S*");

// Get the regular expression string.
string regex = rstrValAttr.Regex;
Console.WriteLine("Regular expression: {0}", regex);
Dim valBase As _
ConfigurationValidatorBase

Dim rstrValAttr As _
New RegexStringValidatorAttribute("\w+\S*")

' Get the regular expression string.
Dim regex As String = _
rstrValAttr.Regex
Console.WriteLine( _
"Regular expression: {0}", regex)

Şunlara uygulanır