On Jul 2, 7:30 am, Nils Rüttershoff <n...@ccsg.de> wrote:

> Rec = 
> re.compile(r"^\d{1,3}.\d{1,3}.\d{1,3}.\d{1,3}\s-\s\d+\s\[(\d{2}/\w+/\d{4}:\d{2}:\d{2}:\d{2})\s\+\d{4}\].*")
> Line = '1.2.3.4 - 4459 [02/Jul/2009:01:50:26 +0200] "GET /foo HTTP/1.0" 200 - 
> "-" "www.example.org" "-" "-" "-"'

I'm not sure how much it will help but if you are only using the regex
to get the date/time group element, it might be faster to replace the
regex with:

>>> date_string = Line.split()[3][1:-1]
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to