-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
03223f8
commit d63b83b
Showing
1 changed file
with
16 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
# Using RegEx, construct a password validation that contains | ||
# At least 8 characters | ||
# contains any type of letters, numbers and $%#@ | ||
# and ends with a number | ||
|
||
import re | ||
|
||
pattern = re.compile(r'[a-zA-Z0-9$%#@]{8,}\d$') | ||
string = 'user123$#@3' | ||
a = pattern.fullmatch(string) | ||
|
||
if a == None: | ||
print('your password must be at least 8 digits long\n contain letters, numbers, any of these symbols $%#@ and end with a number') | ||
|
||
else: | ||
print('logged in') |