Guest User

Untitled

a guest
Oct 16th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. import re
  2.  
  3. sample_list = ['Xkn59438', 'yhdck2', 'eihd39d9', 'chdsye847', 'hedle3455', 'xjhd53e', '45da', 'de37dp']
  4.  
  5. a_result = []
  6. b_result = []
  7. c_result = []
  8.  
  9. def A(value):
  10. result = re.search(r'\w+5+\w', value)
  11. if result:
  12. a_result.append(result.group(0))
  13.  
  14. def B(value):
  15. result = re.search(".*(d|e).*", value)
  16. if result:
  17. b_list.append(result.group(0))
  18.  
  19. for value in sample_list:
  20. if A(value) and B(value):
  21. print("A condition: ", a_list)
  22. print("B condition: ", b_list)
Add Comment
Please, Sign In to add comment