1
0
mirror of https://github.com/donaldzou/WGDashboard.git synced 2024-11-22 07:10:09 +01:00

fixed search ipv6 in the string with comma

This commit is contained in:
Galonza Peter 2021-10-17 21:13:18 +03:00
parent ffa63b3f82
commit 62be683dd8

View File

@ -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: