Guest User

Untitled

a guest
Jan 21st, 2019
126
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. import re
  2.  
  3. with open("input.csv", "r") as insert:
  4. array = []
  5. for line in insert:
  6. array.append(line)
  7.  
  8. for i in range(len(array)):
  9. tempList = array[i].split(',')
  10. print(tempList[0])
  11.  
  12. if tempList[0] == 'student':
  13. matchObj = re.match('d{3}[s]?d{3}[s]?d{3}', tempList[1])
  14. if matchObj:
  15. print('student = Right!')
  16. elif tempList[0] == 'password':
  17. matchObj = re.match('(?=.*d)(?=.*[a-z])(?=.*[A-Z]).{12,}', tempList[1])
  18. if matchObj:
  19. print('password = Right!')
  20. elif tempList[0] == 'username':
  21. matchObj = re.match('(?=.*[a-z])(?=.*[A-Z]).{3,20}', tempList[1])
  22. print(matchObj)
  23. print(tempList[0])
  24. print(tempList[1])
  25. if matchObj:
  26. print('username = Right!')
Add Comment
Please, Sign In to add comment