Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

A man and a dog have an average of three legs.

Beaware of Statistics.

Posted

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]$

"Who is John Galt?"
Posted

Thanx for all answers, fellows!

 

IngisKahn - super, the first RegEx is very good for my purposes!

A man and a dog have an average of three legs.

Beaware of Statistics.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...