[英]Regular Expression validation not working for Chinese culture in ASP.Net
[英]regular expression not working in asp.net
错误 - 报告的链接应该采用正确的格式。 我有一个文本框,我正在验证正确的链接/url 与否。下面是有效链接,但显示无效。 你能告诉我加入正则表达式吗?
<asp:RegularExpressionValidator ID="Vldt_Re_RportLink" Display="Dynamic" ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- :|./?_%&=]*)?"
ControlToValidate="TxtBox_RportdLink" ErrorMessage="<img src='Images/Wrong.png' height='16' width='16'/>Reported Link should be in Proper format"
runat="server">
两者[]
都不在有效字符列表中,因此 url 有效,直到
[user]=140973880&filters[recent]=1&sort=1&o=0
解决方案:
http(s)?://([\\w-]+\\.)+[\\w-]+(/[\\w-\\[\\] :|./?_%&=]*)?
(添加\\[\\]
)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.