This article is a mirror article of machine translation, please click here to jump to the original article.

View: 21465|Reply: 2

[ASP.NET] asp.net validate mailbox format regex

[Copy link]
Posted on 3/27/2015 3:58:06 PM | | | |


  1. <asp:Label ID="lblmail" runat="server" Text="邮箱:"></asp:Label>
  2.         <asp:TextBox ID="txtmail" runat="server"></asp:TextBox>
  3.         <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="邮箱格式不正确!" ControlToValidate="txtmail" Display="Dynamic" ValidationExpression="^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$"></asp:RegularExpressionValidator>
Copy code
asp.net validate mailbox format regex

The effect is as above, see the code yourself!




Previous:Asp.net TextBox can only enter numbers
Next:A social work library built by an internship in the Public Security Bureau
Posted on 3/28/2015 12:02:35 AM |
This is very practical, you have to use regular expressions for everything
Posted on 11/4/2017 1:15:54 PM |
C# uses regular expressions to verify phone numbers, mobile phone numbers, ID numbers
http://www.itsvse.com/thread-2560-1-1.html
(Source: Architect)
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com