Home   |   QuickStart Welcome   |   ASP.NET   |   Web Services   |   How Do I...?   
  |   I want my samples in...      

ASP.NET 2.0 Quickstart Tutorials

RegularExpressionValidator

The RegularExpressionValidator control confirms that the entry matches a pattern defined by a regular expression. This type of validation allows you to check for predictable sequences of characters, such as those in social security numbers, e-mail addresses, telephone numbers, postal codes, and so on.

RegularExpressionValidator uses two key properties to perform its validation: ControlToValidate contains the value to validate, and ValidationExpression contains the regular expression to match.

The following sample illustrates using the RegularExpressionValidator control.

VB RegExValidator1.aspx
Run Sample View Source

For a detailed discussion of Web Forms validation, please see the Validating Form Input Controls section of this QuickStart tutorial.