RegularExpressionValidator

 Rate It (0)

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.  Some common regular expressions are:

  • US Zip Codes:  \d{5}
  • US Phone Numbers:  \d{3}-\d{3}-\d{4}
  • Email address:  \w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

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

Whitepapers/Blogs

Revision number 4, Friday, July 04, 2008 10:48:12 AM by

Comments

Related Articles

customvalidator

The customvalidator control allows writing custom validation for a control. So, if the others validators: RangeValidator, RequiredFieldValidator, RegularExpressionValidator, CompareValidator, is not useful for a specific validation, it is possible to write

Web Controls

Web controls are ASP.NET controls which are understood and compiled on the server and render as HTML markup on the page. Most of the web server controls render their own HTML controls (or many HTML controls). The markup that is output froma web control can

Validation Controls

ASP.NET Validation Controls are powerful server controlsthat areused for validating user input. These controls provides both server side and client side validation. The client side validation featurescan be used to give your users an improved UI experience

Shortcuts

Table of Contents

Top Wiki Contributors

(last 30 days)

  1. mbanavige (14)
  2. codehard (3)
  3. Babunareshnarra (2)
  4. Dungimon (1)
  5. cabhilash (1)
Microsoft Communities