多行文本框上的正则表达式验证 [英] Regular expression validation on multiline textbox

查看:137
本文介绍了多行文本框上的正则表达式验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用Multineline文本框&在多行文本框中将验证代码应用到后面.

Using Multineline textbox & applied validation throgh code behind on multiline text box.

s1 = @"(\d+";
       s2 = @")*\d+";

       string regx = s1 + Functions.ToString(ConfigurationManager.AppSettings["BulkCaseSeparator"].ToString() + s2);

       Regex.Match("example", @".*\n", RegexOptions.Multiline);

       RegularExpressionValidator1.ValidationExpression = regx;





上面的代码用于应用验证.所有验证都可以在多行文本框中很好地传递输入,例如
1213,1415正常工作
但是当像
这样的输入传递时 1415,1617,
1819,
1920,
1415无法正常工作,如何在代码中应用更改,因此此正则表达式也可以在下一行使用.



above code is use for apply validation. all validation are working fine passing input in multiline textbox like
1213,1415 it is working fine
but when pass input like
1415,1617,
1819,
1920,
1415 not working how apply changes in code so this regular expression working on next line also.

推荐答案



检查这些链接.

http://stackoverflow.com/questions/2321445/regular-expression-multiline-validator [ ^ ]

http://www.regular-expressions.info/anchors.html [ http://weblogs.asp.net/cosgood/archive/2003/05/06/6604.aspx [^ ]
Hi,

check these links.

http://stackoverflow.com/questions/2321445/regular-expression-multiline-validator[^]

http://www.regular-expressions.info/anchors.html[^]

http://weblogs.asp.net/cosgood/archive/2003/05/06/6604.aspx[^]


这篇关于多行文本框上的正则表达式验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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