I wish match some line in Cisco configuration based on the destination. To make some test I made the following:
acl = 'ip route 10.5.48.0 255.255.255.0 10.242.245.65'
firewall = '10.242.245.65'
ip = r"(^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$)"
ip_route = (f"ip route {ip} {ip} {firewall}")
if re.search(ip_route, acl):
print(acl)
No result.
I guess the problem is withe the variable ip_route.