共用方式為


RegexStringValidatorAttribute.Regex 屬性

定義

取得用於正則表達式驗證的字串。

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

屬性值

包含用於過濾分配給裝飾配置元素屬性字串的正則表達式的字串。

範例

以下範例說明如何使用該 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)

適用於