Regex Property
Collapse the table of content
Expand the table of content

RegexStringValidatorAttribute.Regex Property


Gets the string used to perform regular-expression validation.

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

Public ReadOnly Property Regex As String

Property Value

Type: System.String

The string containing the regular expression used to filter the string assigned to the decorated configuration-element property.

The following example shows how to use the Regex property.

Dim valBase As _

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

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

.NET Framework
Available since 2.0
Return to top
© 2016 Microsoft