Guest User

Untitled

a guest
Jul 17th, 2017
15,535
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.36 KB | None | 0 0
  1. import re
  2.  
  3. parts = ["@gmail", "@cngmail.", "google", "hotmail"]
  4.  
  5. test2 = test.replace(" ","").replace(",","")
  6. #cut-off comma and whitespaces at the end
  7.  
  8. print(test2) # [email protected]
  9. print(parts[0]) # @gmail
  10.  
  11. print(parts[0] in test2)
  12. print(re.search(parts[0], test2))
  13. print(test2.rfind(parts[0]))
  14.  
  15. @gmail
  16.  
  17. False
  18. None
  19. -1
Advertisement
Add Comment
Please, Sign In to add comment