RegularExpressionValidator::ValidationExpression Property
Gets or sets the regular expression assigned to be the validation criteria. The default value is an empty string (""). This API is obsolete. For information about how to develop ASP.NET mobile applications, see the www.asp.net/mobile Web site.
Assembly: System.Web.Mobile (in System.Web.Mobile.dll)
public: [BindableAttribute(true)] property String^ ValidationExpression { String^ get(); void set(String^ value); }
Property Value
Type: System::String^The regular expression assigned to be the validation criteria.
The RegularExpressionValidator does not perform validation on an empty string. To test for an empty string, use the RequiredFieldValidator and RegularExpressionValidator controls together.
| Exception | Condition |
|---|---|
| HttpException | The regular expression assigned was malformed. |
The following table shows some sample validation expressions:
Type of Validation | Validation Expression |
|---|---|
\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+) | |
Phone number | ((\(\d{3}\) ?)|(\d{3}-))?\d{3}-\d{4} |
URL | http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)? |
Available since 1.1
RegularExpressionValidator Class
System.Web.UI.MobileControls Namespace
Introduction to the RegularExpressionValidator Control
Validation Controls