From 62be683dd859496814f705fc67a4f4b712869dc7 Mon Sep 17 00:00:00 2001 From: Galonza Peter Date: Sun, 17 Oct 2021 21:13:18 +0300 Subject: [PATCH] fixed search ipv6 in the string with comma --- src/dashboard.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dashboard.py b/src/dashboard.py index 93c2daf..f742891 100644 --- a/src/dashboard.py +++ b/src/dashboard.py @@ -46,7 +46,7 @@ def regex_match(regex, text): def check_IP(ip): ip_patterns = ( r"((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|$)){4}", - r"((^|:)([0-9a-fA-F]{0,4})){1,8}$" + r"[0-9a-fA-F]{0,4}(:([0-9a-fA-F]{0,4})){1,7}$" ) for match_pattern in ip_patterns: @@ -71,7 +71,7 @@ def clean_IP_with_range(ip): def check_IP_with_range(ip): ip_patterns = ( r"((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)(\.|\/)){4}([0-9]{1,2})(,|$)", - r"((^|:)([0-9a-fA-F]{0,4})){1,8}\/([0-9]{1,3})(,|$)" + r"[0-9a-fA-F]{0,4}(:([0-9a-fA-F]{0,4})){1,7}\/([0-9]{1,3})(,|$)" ) for match_pattern in ip_patterns: