Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Regex not specific enough
#1
I'm having trouble with regex.
I'm looking for the double quoted string starting with GET

>>> import re
>>> 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"'
>>> re.findall('\"GET .+\"', entry)
['"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"']
I've got it part of the there, but it cannot discern the string that has the word GET in it.

The result that I'm expecting is:
['"GET /access_130930.log HTTP/1.1"']
Reply


Messages In This Thread
Regex not specific enough - by Clunk_Head - Mar-23-2019, 03:47 AM
RE: Regex not specific enough - by woooee - Mar-23-2019, 05:26 AM
RE: Regex not specific enough - by Clunk_Head - Mar-23-2019, 02:52 PM
RE: Regex not specific enough - by DeaD_EyE - Mar-23-2019, 05:27 AM
RE: Regex not specific enough - by ichabod801 - Mar-23-2019, 04:31 PM
RE: Regex not specific enough - by Clunk_Head - Mar-23-2019, 05:32 PM
RE: Regex not specific enough - by woooee - Mar-23-2019, 05:42 PM
RE: Regex not specific enough - by Clunk_Head - Mar-23-2019, 05:44 PM
RE: Regex not specific enough - by ichabod801 - Mar-23-2019, 06:27 PM
RE: Regex not specific enough - by DeaD_EyE - Mar-24-2019, 07:28 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Delete specific lines contain specific words mannyi 2 4,152 Nov-04-2019, 04:50 PM
Last Post: mannyi

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020