fork download
  1. import re
  2.  
  3. s="""(2021-07-29 01:00:00 AM BST)
  4. ---
  5. peter.j.matthew has joined the conversation
  6.  
  7.  
  8.  
  9. (2021-07-29 01:00:00 AM BST)
  10. ---
  11. john cheung has joined the conversation
  12.  
  13.  
  14.  
  15.  
  16. (2021-07-29 01:11:19 AM BST)
  17. ---
  18. allen.p.jonas
  19. Hi, james
  20.  
  21.  
  22. (2021-07-30 12:51:16 AM BST)
  23. ---
  24. karren wenda
  25. how're you ?
  26.  
  27.  
  28.  
  29. ---
  30.  
  31. * * *"""
  32.  
  33. print(re.findall(r"^---[^\S\n]*\n(\S.*?)[^\S\r\n]*\n\S", s, re.M))
Success #stdin #stdout 0.02s 9604KB
stdin
Standard input is empty
stdout
['allen.p.jonas', 'karren wenda']