From da0b3bc56530d360b38072de2ffed1f08c54228b Mon Sep 17 00:00:00 2001 From: Mehdi Abaakouk Date: Fri, 27 Jan 2012 00:17:11 +0100 Subject: [PATCH] Improve ipv6 detection --- lg.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lg.py b/lg.py index 6c2b3a0..e3a63cc 100755 --- a/lg.py +++ b/lg.py @@ -39,7 +39,7 @@ def add_links(text): line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'\1',line) hosts = "/".join(request.path.split("/")[2:]) line = re.sub(r'\[(\w+)\s+((|\d\d\d\d-\d\d-\d\d\s)(|\d\d:)\d\d:\d\d|\w\w\w\d\d)', r'[\1 \2' % hosts, line) - line = re.sub(r'(^|\s+)(([a-f\d]{0,4}:){2,10}[a-f\d]{0,4})', r'\1\2',line , re.I) + line = re.sub(r'(^|\s+)(([a-f\d]{0,4}:){3,10}[a-f\d]{0,4})', r'\1\2',line , re.I) ret_text.append(line) return "\n".join(ret_text)