RegularExpressionAttribute.IsValid(Object) 方法

定义

检查用户输入的值与正则表达式模式是否匹配。Checks whether the value entered by the user matches the regular expression pattern.

public:
 override bool IsValid(System::Object ^ value);
public override bool IsValid (object value);
public override bool IsValid (object? value);
override this.IsValid : obj -> bool
Public Overrides Function IsValid (value As Object) As Boolean

参数

value
Object

要验证的数据字段值。The data field value to validate.

返回

Boolean

如果验证成功,则为 true;否则为 falsetrue if validation is successful; otherwise, false.

例外

数据字段值与正则表达式模式不匹配。The data field value did not match the regular expression pattern.

当前属性格式不正确。The current attribute is ill-formed.

Pattern 不是有效正则表达式。Pattern is not a valid regular expression.

注解

此重写执行特定于字段的正则表达式匹配 valueThis override performs the specific regular expression matching of value field.

适用于