"^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$"try it

解决方案 »

  1.   

    http://www.regexlib.com/Search.aspx
    在这输入Email关键字,能找到你想要的验证代码
      

  2.   

    to icyer() :
    谢谢呀这是Email验证的吧
    可是
    "^\w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w+$"该怎么用呢?
    教教俺吧
    可别怪我是白痴,呵呵...
      

  3.   

    Email:   \w+((-\w+)|(\.\w+))*\@\w+((\.|-)\w+)*\.\w
      

  4.   

    密码的:\w{1,n}
    n是密码的长度
      

  5.   

    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>
      

  6.   

    Regex(REGEXP_IS_VALID_EMAIL)).IsMatch(validate)validate:是你要验证的字符串或者网页上添加RequiredFieldValidator控件,设置该控件的ControlToValidator属性为该验证字符串输入框的ID,设置ErrorMessge属性为你要显示的信息,设置InitalValue为该正则表达式,OK
      

  7.   

    这是个简单例子:
    <%@ 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>
      

  8.   

    <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>