def is_ipv4()

in Azure Firewall/Template - Logic App and Automation Account for Adding O365 Rules to Azure Firewall/o365_rules.py [0:0]


def is_ipv4(ip_address):
    return bool(re.match(r"^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(?:/\d{1,2}|)$",str(ip_address)))