求Email验证和密码验证的正则表达式 "^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$"try it 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 http://www.regexlib.com/Search.aspx在这输入Email关键字,能找到你想要的验证代码 to icyer() :谢谢呀这是Email验证的吧可是"^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$"该怎么用呢?教教俺吧可别怪我是白痴,呵呵... Email: \w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w 密码的:\w{1,n}n是密码的长度 email 的<asp:RegularExpressionValidator id="RegularExpressionValidator4" runat="server" ErrorMessage="电子信箱输入有错误" Display="Dynamic" Font-Size="9pt" ControlToValidate="email" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>密码的<asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" ErrorMessage="用户密码有不合法字符" Font-Size="9pt" ControlToValidate="pass2" ValidationExpression="^[^<']*"></asp:RegularExpressionValidator> Regex(REGEXP_IS_VALID_EMAIL)).IsMatch(validate)validate:是你要验证的字符串或者网页上添加RequiredFieldValidator控件,设置该控件的ControlToValidator属性为该验证字符串输入框的ID,设置ErrorMessge属性为你要显示的信息,设置InitalValue为该正则表达式,OK 这是个简单例子:<%@ Page Language="C#" %> <html> <head> <script runat="server"> void ValidateBtn_Click(Object sender, EventArgs e) { if (Page.IsValid) { lblOutput.Text = "Page is Valid!"; } else { lblOutput.Text = "Page is InValid!"; } } </script> </head> <body> <h3>RegularExpressionValidator Sample</h3> <p> <form runat="server"> <table bgcolor="#eeeeee" cellpadding="10"> <tr valign="top"> <td colspan="3"> <asp:Label id="lblOutput" Text="Enter a 5 digit zip code" Font-Name="Verdana" Font-Size="10pt" runat="server"/> </td> </tr> <tr> <td colspan="3"> <font <b>Personal Information</b> </td> </tr> <tr> <td align="right"> Zip Code: </td> <td> <asp:TextBox id="TextBox1" runat="server"/> </td> <td> <asp:RegularExpressionValidator id="RegularExpressionValidator1" ControlToValidate="TextBox1" ValidationExpression="------正则表达式放这--------" Display="Static" EnableClientScript="false" ErrorMessage="...错误提示" runat="server"/> </td> </tr> <tr> <td></td> <td> <asp:Button text="Validate" OnClick="ValidateBtn_Click" runat="server"/> </td> <td></td> </tr> </table> </form> </body> </html> <td align="right">Email:</td> <td><asp:TextBox runat="server" size="40" id="Email" /> <asp:RequiredFieldValidator runat="server" Text="(必要栏位)" ControlToValidate="Email" EnableClientScript="False" Display="Dynamic" /> <asp:RegularExpressionValidator runat="server" ControlToValidate="Email" Text="(Email 应含有 @ 符号)" ValidationExpression=".{1,}@.{3,}" EnableClientScript="False" Display="Dynamic"/> </td> IIS测试网站出现了问题 URL重写 和 URL转发 是一个原理吧? 高手们能帮我改下这段代码吗? 麻烦大家帮我解决个问题,非常感谢!! cs文件读 js中保存的cookie 俺的自定义的数据查询类,出现错误了,不能解决呀,高人帮助, 能否动态调用类 ■■■下午要用了,江湖救急,看下这段post过来的XML数据读取的问题!■■■ 用什么方法作的链接才能在地址栏中不显示链接地址? 正则表达式怎么替换引号? 请问怎样在DataGrid中放置Checkbox控件? 象http://www.aspxcn.com/论坛的首页是怎么做的?
在这输入Email关键字,能找到你想要的验证代码
谢谢呀这是Email验证的吧
可是
"^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$"该怎么用呢?
教教俺吧
可别怪我是白痴,呵呵...
n是密码的长度
Font-Size="9pt" ControlToValidate="email" ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator>
密码的<asp:RegularExpressionValidator id="RegularExpressionValidator3" runat="server" ErrorMessage="用户密码有不合法字符" Font-Size="9pt"
ControlToValidate="pass2" ValidationExpression="^[^<']*"></asp:RegularExpressionValidator>
<%@ Page Language="C#" %> <html>
<head>
<script runat="server">
void ValidateBtn_Click(Object sender, EventArgs e)
{
if (Page.IsValid)
{
lblOutput.Text = "Page is Valid!";
}
else
{
lblOutput.Text = "Page is InValid!";
}
}
</script>
</head>
<body>
<h3>RegularExpressionValidator Sample</h3>
<p>
<form runat="server">
<table bgcolor="#eeeeee" cellpadding="10">
<tr valign="top">
<td colspan="3">
<asp:Label id="lblOutput"
Text="Enter a 5 digit zip code"
Font-Name="Verdana"
Font-Size="10pt"
runat="server"/>
</td>
</tr>
<tr>
<td colspan="3">
<font <b>Personal Information</b>
</td>
</tr>
<tr>
<td align="right">
Zip Code:
</td>
<td>
<asp:TextBox id="TextBox1"
runat="server"/>
</td>
<td>
<asp:RegularExpressionValidator id="RegularExpressionValidator1"
ControlToValidate="TextBox1"
ValidationExpression="------正则表达式放这--------"
Display="Static"
EnableClientScript="false"
ErrorMessage="...错误提示"
runat="server"/>
</td>
</tr>
<tr>
<td></td>
<td>
<asp:Button text="Validate"
OnClick="ValidateBtn_Click"
runat="server"/>
</td>
<td></td>
</tr>
</table>
</form>
</body>
</html>
<td><asp:TextBox runat="server" size="40" id="Email" />
<asp:RequiredFieldValidator runat="server" Text="(必要栏位)"
ControlToValidate="Email" EnableClientScript="False"
Display="Dynamic" />
<asp:RegularExpressionValidator runat="server"
ControlToValidate="Email" Text="(Email 应含有 @ 符号)"
ValidationExpression=".{1,}@.{3,}"
EnableClientScript="False" Display="Dynamic"/>
</td>