RegexStringValidatorAttribute.Regex Property (System.Configuration)

Switch View :
ScriptFree
.NET Framework Class Library
RegexStringValidatorAttribute.Regex Property

Gets the string used to perform regular-expression validation.

Namespace:  System.Configuration
Assembly:  System.Configuration (in System.Configuration.dll)
Syntax

Visual Basic
Public ReadOnly Property Regex As String
	Get
C#
public string Regex { get; }
Visual C++
public:
property String^ Regex {
	String^ get ();
}
F#
member Regex : string

Property Value

Type: System.String
The string containing the regular expression used to filter the string assigned to the decorated configuration-element property.
Examples

The following example shows how to use the Regex property.

Visual Basic

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)


C#


            ConfigurationValidatorBase valBase;

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

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



Version Information

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Platforms

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also

Reference