Richa Garg

Richa Garg

  • NA
  • 10.9k
  • 4.9m

How to write the function to check the password?

Jul 13 2012 1:05 AM
If I want to write the function to check the password entered is correct or not based on the following conditions,how can i write it?
1) It must have atleast one lower case character and one digit.
2) It must not have any upper case character and one digit.
3) Length should be between 5-12
4) It should not have any same immediate pattern like,
  -> abcanan1 : not acceptable , because of an pattern a.
  -> abc11se : not acceptable , because of 11.
  -> 123sd123 : acceptable , as not immediate pattern.
  -> adfasdsdf : not acceptable , as no digits.
  -> Aasdfasd12 : not acceptable, as have uppercase character.

Please help to to write this function.

Answers (1)