accept more IPv6 addresses
[zonemaker.git] / zone.py
diff --git a/zone.py b/zone.py
index 5cd0d72cac2b744fd4b807cf49e79b4ffd0434e9..cbde17050231d3c00b0459880ba4e9cce3089c85 100644 (file)
--- a/zone.py
+++ b/zone.py
@@ -33,7 +33,7 @@ week = 7*day
 
 REGEX_label = r'[a-zA-Z90-9]([a-zA-Z90-9-]{0,61}[a-zA-Z90-9])?' # max. 63 characters; must not start or end with hyphen
 REGEX_ipv4  = r'^\d{1,3}(\.\d{1,3}){3}$'
-REGEX_ipv6  = r'^[a-fA-F0-9]{1,4}(:[a-fA-F0-9]{1,4}){7}$'
+REGEX_ipv6  = r'^[a-fA-F0-9]{1,4}(::?[a-fA-F0-9]{1,4}){1,7}$'
 
 def check_label(label: str) -> str:
     label = str(label)