RegularExpressionAttribute::Pattern Property

Gets the regular expression to use for validation of the associated member.

Namespace:  System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

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

Property Value

Type: System::String
The regular expression to use for validation of the associated member.

The value of the property is not tested against the pattern when the property contains nullptr or an empty string ("").To validate that the value is not nullptr or an empty string, use the RequiredAttribute attribute.

The following examples show how to apply the RegularExpressionAttribute attribute to a property that contains values for a last name.

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

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show: