fork(1) download
  1.  
  2.  
  3. import re
  4.  
  5. regex = r"^([^|]+)(?:\|\|[^|]+){2}\|\|([^|]+)"
  6.  
  7. test_str = ("Runs_WithWolves || Sat Mar 21 09:38:12 +0000 2020 || Mid December 2019 two friends of mine had caught COVID-19 through work colleagues traveling from Muhan China, but i\\xe2\\x80\\xa6 || 0.7188042218 || false fact or prevention\n")
  8.  
  9. matches = re.finditer(regex, test_str, re.MULTILINE)
  10.  
  11. for match in matches:
  12. print(match.group(1))
  13. print(match.group(2))
  14.  
  15.  
Success #stdin #stdout 0.03s 9544KB
stdin
Standard input is empty
stdout
Runs_WithWolves 
 0.7188042218