文本框正则表达式(仅允许数字或数字和点的组合)? [英] Textbox Regular Expression (Allow only Numbers Or Combination of number and Dot)?

查看:264
本文介绍了文本框正则表达式(仅允许数字或数字和点的组合)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想要一个正则表达式,它接受像
这样的格式 小心地,文本框的最大长度为5

.11
6
.6
66
06.66
6.66
66.11

任何帮助将不胜感激.


问候,
帕万.

Hi
I want a Regular Expression which accepts the format like
Carefully maxlength of Textbox is 5

.11
6
.6
66
06.66
6.66
66.11

Any help would be really appreciated.


Regards,
Pawan.

推荐答案

选中此

Check this

<pre lang="xml"><asp:TextBox ID="txtCurrencey" runat="server" MaxLength="5"></asp:TextBox>
<asp:RegularExpressionValidator ID="rgfldvalidator" ControlToValidate="txtCurrencey"

runat="server" ErrorMessage="Please enter the numbers only" ValidationExpression="^[0-9]*\.?[0-9]+


" > < /asp:RegularExpressionValidator >






这篇关于文本框正则表达式(仅允许数字或数字和点的组合)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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