ASP.NET RegularEx pressionValidator,验证在非比赛? [英] ASP.NET RegularExpressionValidator, validate on a non-match?

查看:167
本文介绍了ASP.NET RegularEx pressionValidator,验证在非比赛?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有使用RegularEx pressionValidator验证,只有当ValidationEx pression不匹配的方法吗?特别是使用PO BOX正则表达式来验证这是一个地址不会邮政信箱。

Is there a way to use the RegularExpressionValidator to validate only when the ValidationExpression does not match? In particular use a PO BOX regex to validate an address that is NOT a PO BOX.

谢谢!

推荐答案

您可以有效使用的负前瞻

例如,认为只有数字的字符串匹配下面的正前pression:

For example, consider the following regular expression that matches only a string of digits:

^\d+$

这前pression就会颠倒如下:

This expression could be inverted as follows:

^(?!\d+$).*$

这篇关于ASP.NET RegularEx pressionValidator,验证在非比赛?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆