fork download
  1. import re
  2.  
  3. results = """
  4. Hospitality
  5. Customer Care
  6. Wick , John 12:00-20:00
  7. Wick , John 10:00-17:00
  8. Obama , Barack 06:00-14:00
  9. Musk , Elon 07:00-15:00
  10. Wasouski , Mike 06:30-14:30
  11. Production
  12. Fries
  13. Piper , Billie 12:00-20:00
  14. Tennent , David 06:30-14:30
  15. Telsa, Nikola 11:45-17:00
  16. Beverages & Desserts in a Dual Lane Drive-thru with a split beverage cell
  17. Timebomb , Tim 06:30-14:30
  18. Freeman , Matt 08:00-16:00
  19. Cool , Tre 11:45-17:00
  20. Sausage
  21. Prestly , Elvis 06:30-14:30
  22. Fat , Mike 06:30-14:30
  23. Knoxville , Johnny 06:00-14:00
  24. Man , Wee 05:00-12:00
  25. Heartness , Jack 09:00-16:00
  26. Breakfast BOP
  27. Schofield , Phillip 06:30-14:15
  28. Burns , George 06:30-14:15
  29. Johnson , Boris 06:30-14:30
  30. Milliband, Edd 06:30-14:30
  31. Trump , Donald 10:00-17:00
  32. Biden , Joe 08:00-16:00
  33. Tempering & Prep
  34. Clinton , Hillary 11:00-19:00
  35.  
  36. """
  37.  
  38. matches=[''.join([m.group(1), m.group(2)]) for m in re.finditer(r"([A-Za-z']+)\s*,\s*([A-Za-z'.]+)\s+\d+:\d+-\d+:\d+", results)]
  39.  
  40. print(matches)
Success #stdin #stdout 0.02s 9404KB
stdin
Standard input is empty
stdout
['WickJohn', 'WickJohn', 'ObamaBarack', 'MuskElon', 'WasouskiMike', 'PiperBillie', 'TennentDavid', 'TelsaNikola', 'TimebombTim', 'FreemanMatt', 'CoolTre', 'PrestlyElvis', 'FatMike', 'KnoxvilleJohnny', 'ManWee', 'HeartnessJack', 'SchofieldPhillip', 'BurnsGeorge', 'JohnsonBoris', 'MillibandEdd', 'TrumpDonald', 'BidenJoe', 'ClintonHillary']