title: Password validator is not working in android
body: <p>In my application I am accepting a password from the user which should be in following format:-</p>
  
  <ul>
  <li>case sensitive and</li>
  <li>must be at least 6 characters long,</li>
  <li>including at least
  <ul>
  <li>one letter (a-Z),</li>
  <li>one number (0-9) and</li>
  <li>one of the following special characters:!=+*;:-,._{[()]}#%?@</li>
  </ul></li>
  </ul>
  
  <p>So by following the tutorial given here: 
  <a href="http://www.mkyong.com/regular-expressions/how-to-validate-password-with-regular-expression/" rel="nofollow">http://www.mkyong.com/regular-expressions/how-to-validate-password-with-regular-expression/</a>
  I have created my own pattern as:-</p>
  
  <pre><code>private static final String PASSWORD_PATTERN = "($\\S*(?=\\S{6,})(?=\\S*[a-z])(?=\\S*[A-Z])(?=\\S*[\\d])(?=\\S*[\\W])\\S*$)";
  </code></pre>
  
  <p>But it is not working properly. If I enter a correct value for the password as per pattern, it still displays an error to me.</p>
  
  <p>Please tell me what's happening here; what error is there?</p>
  
  <p>Here is my code:- </p>
  
  <pre><code> PWD_Validate = new PasswordValidator();
      String password = TXT_PassWord.getText().toString();
  
     if (PWD_Validate.validate(password))
              {
              }                                                                                         
                                                                                                           else{                                                                                       }                                                                                            it takes me every time in else block, even I entered a correct passwaord.
  </code></pre>