Regular Expression for ideal Password

We usually have to validated the password being submitted by the user during the registration.

Its is very much essential to provide the regular expression validtor here.
In my case i had this urgent requirement to do so.

In my case the password entered by the user had to be at least 6 characters long and max 10 characters long.

Moreover i also had this requirement of including at least one Upper case ,lower case and one numeric digit.

Hence , i came up with the following reular expression that suited all my cases :-


<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<br />
<asp:TextBox ID="txtPassword" runat="server">
<br />

Tip for password : at least 6 digit long, at least one Upper Case,Lower Case and Numeric digit</div>


<asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ControlToValidate="txtPassword"
ErrorMessage="Please Read the directions Tip above for the ideal password"


I hope it helps the need ...cheers...happy codeing...:-)


Author: Manindra Kumar Upadhyay09 Apr 2010 Member Level: Gold   Points : 1

try this link:

  • Do not include your name, "with regards" etc in the comment. Write detailed comment, relevant to the topic.
  • No HTML formatting and links to other web sites are allowed.
  • This is a strictly moderated site. Absolutely no spam allowed.
  • Name: