SIGN UP MEMBER LOGIN:    
Blog

Most secure Password regular expession validator

Posted by hameed Blogs | Learn .NET Sep 01, 2010
password must be at least 6 characters and must contain at least 3 of the following 4 categories: uppercase, lowercase, digits, symbols (e.g. !, $, #, %).

<asp:TextBox ID="txtPassword" runat="server" style="margin-bottom: 0px"></asp:TextBox>
<asp:RegularExpressionValidator ID="RegEv" runat="server"
            ErrorMessage="RegularExpressionValidator"  ControlToValidate="txtPassword"
            ValidationExpression="^(^.*(?=.{4,8})(?=.*\d)(?=.*[A-Za-z])(?=.*[@#$%^&+=]).*$)$|^(?=.*\d)(?=.*[a-z])(?=.*[A-Z]).{4,8}$|
            (?=^.{4,8}$)(\w*(?=\w*\d)(?=\w*[a-z])(?=\w*[A-Z])\w*)$
            |^(^.*(?=.{4,8})(?=.*[a-z])(?=.*[A-Z])(?=.*[@#$%^&+=]).*$)$"></asp:RegularExpressionValidator>
       
share this blog :
post comment