Я использую приведенный ниже код:
import re
destination_nat = "Disabled rules are not shown\nCodes: X - exclude rule\n\nrule intf translation \n---- ---- ----------- \n1 eth0 daddr 172.27.59.0/24 to 192.168.1.0/24 \n proto-all dport ANY"
destination_split = destination_nat.split("\n")
for item in destination_split:
test = re.findall(r'\d+.\s+eth\d\s+daddr', item)
print(test)
Но не получаю результатов в тесте.
Когда я заменяю переменную 'item' в строке findall текстом указанного c Строка, я получаю результат.
Я понятия не имею, что я делаю неправильно.