regex - Python - Subtracting a List with strings of a List with Regexes -
i have 2 lists, 1 full of regexes , other full of strings. have check if list strings complete, regex list "complete". want subtract regexes match strings , print leftovers.
list regexes:
["ntp server x.x.x.x", "ntp server x.x.x.x", "ntp server x.x.x.x","logging x.x.x.x", "snmp-server community xxxx ro " + regex_string_with_digits_and_special_marks, {"snmp": ["(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " deny\s+any)", "(access-list " + regex_string_with_digits_and_special_marks + " remark .+)"], "vty": ["(access-list " + regex_string_with_digits_and_special_marks + " permit x.x.x.x)", "(access-list " + regex_string_with_digits_and_special_marks + " deny\s+any)", "(access-list " + regex_string_with_digits_and_special_marks + " remark .+)"]}]
list strings:
[{'vty': []}, {'snmp': ['access-list 2 remark *** snmp ***', 'access-list 2 permit x.x.x.x', 'access-list 2 permit x.x.x.x', 'access-list 2 permit x.x.x.x', 'access-list 2 deny any']}, 'snmp-server community xxxx ro 2']
is there way?
Comments
Post a Comment