+def check_hex(data: str) -> str:
+ data = str(data)
+ if re.match('^[a-fA-F0-9]+$', data):
+ return data
+ raise Exception(data+" is not valid hex data")
+
+def check_ipv4(address: str) -> str:
+ address = str(address)
+ if re.match(REGEX_ipv4, address):
+ return address
+ raise Exception(address+" is not a valid IPv4 address")
+
+def check_ipv6(address: str) -> str:
+ address = str(address)
+ if re.match(REGEX_ipv6, address):
+ return address
+ raise Exception(address+" is not a valid IPv6 address")
+