One of the fundamental points of computer security is the password. It may be useful to help administrators and group leaders by encouraging them to use a complex passwords. These steps below will help you create a process more secure with regular expression (or Regex). The code presented would then be used for letting the user change their passwords.
The key to strong password construction comes down to a combination of length, complexity, and randomness (lowercase or uppercase characters, digits and special symbols). Using Regex will help you to set your password. If you are not familiar with regular expressions, do not worry. We will decompose the string.
/^(?=.*[A-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[$@])(?!.*[iIoO])\S{6,12}$/
/^
Start of the string.(?=.*[A-z])
must contains a characters (lowercase or uppercase characters).(?=.*[a-z])
must contains one lowercase characters.(?=.*[A-Z])
must contains one uppercase characters.(?=.*[0-9])
must contains one digit from 0-9.(?=.*[$@])
must contains one special symbols in this list $ and @.(?!.*[iIoO])
match any charcuter except i I o and O.\S{6,12}
length at least 6 characters and a maximum of 12.$/
End of the string.Whole combination is means: 6 to 12 characters string with at least one digit and one upper case letter ( except i I o and O), one special symbol ("@$"). This regular expression pattern is very useful to implement a strong and complex password.
Note: The grouping formula order does not matter.
Do not forget, if you are already familiar with the Regex syntax, you can edit your own regular expression directly! Below are a few more examples:
Can you guess this string?
/^
(?=.*[A-z])
(?=.*[A-Z])
(?=.*[0-9])
(?=.*[*_%$@])
(?!.*[pPoO])
\S{6,}
$/
Go to the Administration Interface ->My account settings->Password policy