def validateAllowedIP(allowedIPs): validateCheck = False if isinstance(allowedIPs, str): allowedIPArray = allowedIPs.split(',') pattern = re.compile(r"^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$"); pattern2 = re.compile(r"^regex\([0-9*.\\]{0,1000}\)$"); for allowedIP in allowedIPArray: allowedIP = allowedIP.strip() if pattern.match(allowedIP) or pattern2.match(allowedIP) or allowedIP == "*": validateCheck = True else: validateCheck = False return validateCheck return validateCheck :neocat_shocked_googly_woozy: