RegexStringValidatorAttribute Constructor (String^)

 

Initializes a new instance of the RegexStringValidatorAttribute object.

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

public:
RegexStringValidatorAttribute(
	String^ regex
)

Parameters

regex
Type: System::String^

The string to use for regular expression validation.

The regex parameter contains the regular expression pattern that a string must match before it can be assigned to the decorated configuration-element property.

You use this constructor in the attributed model to ensure that the string value assigned to the related property contains only the allowed characters.

The following example shows how to use the RegexStringValidatorAttribute constructor.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: