From 3ab82113408dab600014af274388dc210aaaafa2 Mon Sep 17 00:00:00 2001 From: Pratik B <65227741+pratikb0501@users.noreply.github.com> Date: Tue, 2 Jun 2020 13:22:42 +0530 Subject: [PATCH] Update Day6.md I've added a short solution, using Regular Expression, to the Question 18. --- Status/Day 6.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Status/Day 6.md b/Status/Day 6.md index 7bba039..bdcff0f 100644 --- a/Status/Day 6.md +++ b/Status/Day 6.md @@ -153,6 +153,18 @@ for i in s: print(",".join(lst)) ``` +**OR** + +'''python +import re + +a = input('Enter passwords: ').split(',') +pass_pattern = re.compile(r"^(?=.*[0-9])(?=.*[a-z])(?=.*[A-Z])(?=.*[$#@]).{6,12}$") +for i in a: + if pass_pattern.fullmatch(i): + print(i) +''' + --- # Question 19