Mar-23-2019, 02:52 PM
(Mar-23-2019, 05:26 AM)woooee Wrote: Regex is the difficult way to do it
entry = '77.247.22.51 - - [08/Mar/2019:18:29:01 -0700] "GET /access_130930.log HTTP/1.1" 404 73 "http://finasteridrabatt.npage.de/" "Mozilla/5.0 (Windows NT 5.1; rv:12.0) Gecko/20100101 Firefox/12.0" "redlug.com"' if '"GET' in entry: location=entry.index('"GET ') location_2=entry.index('"', location+1) print(location, entry[location:location_2+1])
I appreciate it but the point is that I'm teaching myself about regex.