System.ComponentModel.DataAnnotations 4.0.0.0 System.ComponentModel.DataAnnotations.ValidationAttribute System.AttributeUsage(System.AttributeTargets.Property | System.AttributeTargets.Field | System.AttributeTargets.Parameter | System.AttributeTargets.All, AllowMultiple=false)

You apply the RegularExpressionAttribute attribute to a property when you need to validate values for the property against a regular expression. The regular expression enables you to specify very precisely the format of valid values. The Pattern property contains the regular expression.If the value of the property is null or an empty string (""), the value automatically passes validation for the RegularExpressionAttribute attribute. To validate that the value is not null or an empty string, use the RequiredAttribute attribute.

Specifies that a data field value in ASP.NET Dynamic Data must match the specified regular expression.

- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

  The regular expression that is used to validate the data field value.
- Method
  4.0.0.0
  System.String ``

  The creates the error message by using the name of the data field that caused the validation failure. You can override this method in custom validation attributes to customize how errors are created or to provide a more complex message that contains parameters that you evaluate at run time.

  Formats the error message to display if the regular expression validation fails.

  The formatted error message.

  The name of the field that caused the validation failure.
- Method
  4.0.0.0
  System.Boolean `` To be added.

  Checks whether the value entered by the user matches the regular expression pattern.

  true if validation is successful; otherwise, false.

  The data field value to validate.
- Property
  4.0.0.0
  System.String To be added. To be added.

  Gets the regular expression pattern.