Skip to content

Instantly share code, notes, and snippets.

View mavisyupyup1's full-sized avatar

Grace Liu mavisyupyup1

View GitHub Profile
@mavisyupyup1
mavisyupyup1 / StrongPasswordRegex.md
Last active March 7, 2022 15:41
Strong Password Regex Tutorial

Strong Password Regex Tutorial

A regular expression (shortened as regex) is a sequence of characters that specifies a search pattern in text. The patterns are often used by string-search algorithms for "find" or " find and replace" operations or for input validation (i.e if input matches requirement, e.g. if you input a phone that is in fact a phone number and not a name of a country). See more on wikipedia.

Summary

We have all been asked to create a password and told if that our password is not strong enough or does not contain a special character. As you might have guessed, password regex is behind this! In this regex tutorial I will be describing how to understand a strong password regex. A strong password regex looks like this:

^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[!@#\$%\^&\*])(?=.{8,})