验证至少5位数的字母数字值 [英] validating minimum 5 digit alpha numeric value

查看:69
本文介绍了验证至少5位数的字母数字值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,
我在使用正则表达式时遇到问题.我必须验证用户名,
符合以下要求
1.仅接受字母数字值.
2.以字符值开头.
3.接受最少5个值.
我该怎么办.
请帮我 .
谢谢大家.

Hello Friends ,
I have a problem regarding regular expression .I have to validate a user name ,
with following requirements
1. It will accept only alpha numeric value.
2. Starting with a character value.
3. Accepting minimum 5 values.
How can i do it .
Please help me .
Thanks all in advance.

推荐答案

尝试一下

try this

<asp:TextBox ID="TextBox1" MaxLength="5"  runat="server"></asp:TextBox><asp:RegularExpressionValidator

           ID="RegularExpressionValidator1" ControlToValidate="TextBox1" ValidationExpression="^[A-Za-z]\w*" runat="server" ErrorMessage="RegularExpressionValidator"></asp:RegularExpressionValidator>
           <asp:Button ID="btn" Text="Check" runat="server" />


希望^ ]可能会帮助您.

根据您的要求进行相应的验证.
Hope this[^] might help you.

Validate it accordingly as per your requirement.


这篇关于验证至少5位数的字母数字值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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