fork download
  1. import re
  2.  
  3. text = '146.204.224.152 - feest6811 [21/Jun/2019:15:45:24 -0700] "POST /incentivize HTTP/1.1" 302 4622\n197.109.77.178 - kertzmann3129 [21/Jun/2019:15:45:25 -0700] "DELETE /virtual/solutions/target/web+services HTTP/2.0" 203 26554\n156.127.178.177 - [21/Jun/2019:15:45:27 -0700] "DELETE /interactive/transparent/niches/revolutionize HTTP/1.1'
  4.  
  5. print (re.findall(r"(?<=-\s)[a-zA-Z0-9]+|-(?= \[)", text))
  6.  
  7. print(re.findall(r"(?:POST|DELETE) \S+ HTTP/(?:1\.[01]|2.0)", text))
  8.  
  9. print(re.findall(r"\"([A-Z]+\s/[a-zA-Z][^\"]+)(?:\"|$)", text))
Success #stdin #stdout 0.02s 9420KB
stdin
Standard input is empty
stdout
['feest6811', 'kertzmann3129', '-']
['POST /incentivize HTTP/1.1', 'DELETE /virtual/solutions/target/web+services HTTP/2.0', 'DELETE /interactive/transparent/niches/revolutionize HTTP/1.1']
['POST /incentivize HTTP/1.1', 'DELETE /virtual/solutions/target/web+services HTTP/2.0', 'DELETE /interactive/transparent/niches/revolutionize HTTP/1.1']