c#中的正则表达式 [英] Regex expression in c#

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

问题描述

您好,

在我的应用程序中,我有文本框,用户可以在其中输入数字值,即钱...所以我应该限制用户只应插入数字或小数也



例如:

5000

266256.55

66666.54

8484.00



请建议我使用最好的正则表达式来接受c#

解决方案

中的上述格式。转到Ajax工具

< asp:TextBox ID =   txtyearly runat =   server宽度=   128px >  < /   asp:TextBox  > < asp:FilteredTextBoxExtender 
ID = FilteredTextBoxExtender6 TargetControlID = txtyearly runat = server FilterType = 数字 >
< / asp:FilteredTextBoxExtender >


Hello,
In my application I have text boxes in which user can enter number values i.e money... So I should restrict user should only insert numerics or decimals also

Example:
5000
266256.55
66666.54
8484.00

Please suggest me a best regex expression to accept only above formats in c#

解决方案

Go for Ajax tools

<asp:TextBox ID="txtyearly" runat="server" Width="128px"></asp:TextBox><asp:FilteredTextBoxExtender
                       ID="FilteredTextBoxExtender6" TargetControlID="txtyearly" runat="server" FilterType="Numbers">
                   </asp:FilteredTextBoxExtender>


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

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