hrabia Posted August 9, 2005 Posted August 9, 2005 I'd like to check in my program user password for quality (mixed case, letters and numbers and so on). I've googled but without success. Any ideas? Thanx in advance Adam Quote A man and a dog have an average of three legs. Beaware of Statistics.
neodammer Posted August 9, 2005 Posted August 9, 2005 You could use RegEx but thats at least for me alittle on the hardside. About the only thing I can think of at the moment unless there is a way to search for a # and a letter in the same string and just use a bunch of if statements etc.. Quote Enzin Research and Development
mskeel Posted August 9, 2005 Posted August 9, 2005 A regular expression is definately the way to go. If you are unfamiliar it might be a little tough, but if you get a good helper tool like The Regex Coach and a decent tutorial you will be well on your way. Plus, if you run into trouble, you can always post here if you run into trouble or need more specific help. Quote
IngisKahn Posted August 9, 2005 Posted August 9, 2005 This will match a password that has at least 2 numbers, 2 lower case letters, 2 upper case letters, and 8 to 20 characters: ^(?=.*?\d.*?\d)(?=.*?[a-z].*?[a-z])(?=.*?[A-Z].*?[A-Z])[\da-zA-Z]{8,20}$ If you just want to check if it has multi-case and digits: ^(?=.*?\d)(?=.*?[a-z])(?=.*?[A-Z])[\da-zA-Z]$ Quote "Who is John Galt?"
hrabia Posted August 12, 2005 Author Posted August 12, 2005 Thanx for all answers, fellows! IngisKahn - super, the first RegEx is very good for my purposes! Quote A man and a dog have an average of three legs. Beaware of Statistics.
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.