Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- with open("input.csv", "r") as insert:
- array = []
- for line in insert:
- array.append(line)
- for i in range(len(array)):
- tempList = array[i].split(',')
- print(tempList[0])
- if tempList[0] == 'student':
- matchObj = re.match('d{3}[s]?d{3}[s]?d{3}', tempList[1])
- if matchObj:
- print('student = Right!')
- elif tempList[0] == 'password':
- matchObj = re.match('(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{12,}', tempList[1])
- if matchObj:
- print('password = Right!')
- elif tempList[0] == 'username':
- matchObj = re.match('(?=.*[a-z])(?=.*[A-Z]).{3,20}', tempList[1])
- print(matchObj)
- print(tempList[0])
- print(tempList[1])
- if matchObj:
- print('username = Right!')
Add Comment
Please, Sign In to add comment