diff --git a/lg.py b/lg.py index 40caa95..b8f829c 100644 --- a/lg.py +++ b/lg.py @@ -76,7 +76,7 @@ def add_links(text): ret_text.append(re.sub(r'(\d+)', r'\1', line)) else: line = re.sub(r'([a-zA-Z0-9\-]*\.([a-zA-Z]{2,3}){1,2})(\s|$)', r'\1\3', line) - line = re.sub(r'AS(\d+)', r'AS\1', line) + line = re.sub(r'(?<=\[)AS(\d+)', r'AS\1', line) line = re.sub(r'(\d+\.\d+\.\d+\.\d+)', r'\1', line) if len(request.path) >= 2: hosts = "/".join(request.path.split("/")[2:])