Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #RegEx for password for CMatch (Case-Sensitive match)
- # * Must have at least one digit
- # * Must have at least one alhabetical symbol in lower case
- # * Must have at least one alhabetical symbol in upper case
- # * Must be at least 8 characters long
- # (!) Warning, regex uses LookBehind logic. Google for "RegEx LookBehind"
- $regEx = '^(?<PASS>.{8,})(?<=.*[A-Z].*)(?<=.*[a-z].*)(?<=.*[0-9].*)$'
- #Password list
- $passwords = @( @'
- Aa1234567
- aA123456
- 213A41a34
- 123567Aa
- 123Aa
- 1223aA
- 12234567aA
- ERR1234
- err
- erRrR
- 3333333
- '@ -split "`r`n" )
- #CHecking list
- forEach ($s in $passwords )
- {
- Write-Host -ForegroundColor Gray "Checking [$($s)]...`t" -NoNewline
- if ($s -CMatch $regEx) {
- Write-Host -ForegroundColor Green "[$($Matches['PASS'])]:GOOD"
- } else {
- Write-Host -ForegroundColor Red "[$($s)]:BAD"
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement