RegularExpressionValidator.ValidationExpression プロパティ

定義

検証条件として割り当てられた正規表現を取得または設定します。 既定値は空の文字列 ("") です。 この API は廃止されています。 ASP.NET モバイル アプリケーションの開発方法については、「Mobile Apps&」を参照してください。ASP.NET

public:
 property System::String ^ ValidationExpression { System::String ^ get(); void set(System::String ^ value); };
[System.ComponentModel.Bindable(true)]
public string ValidationExpression { get; set; }
[<System.ComponentModel.Bindable(true)>]
member this.ValidationExpression : string with get, set
Public Property ValidationExpression As String

プロパティ値

検証条件として割り当てられた正規表現。

RegularExpressionValidatorは、空の文字列に対して検証を実行しません。 空の文字列をテストするには、 RequiredFieldValidator コントロールと RegularExpressionValidator コントロールを一緒に使用します。

属性

例外

割り当てられた正規表現の形式が正しくありません。

注釈

次の表に、いくつかの検証式のサンプルを示します。

検証の種類 検証式
Email \w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)
電話番号 ((\(\d{3}\) ?)|(\d{3}-)?\d{3}-\d{4}
URL http://([\w-]+\.)+[\w-]+(/[\w-./?%&=]*)?

適用対象

こちらもご覧ください