From 1892e80aa4dec47b25b27fdb00d84f1525a66c31 Mon Sep 17 00:00:00 2001 From: Steven Black Date: Thu, 27 Jul 2023 15:34:13 -0400 Subject: [PATCH] Reverting changes in PR ##2391. --- updateHostsFile.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/updateHostsFile.py b/updateHostsFile.py index 986f2023a..5c8271492 100755 --- a/updateHostsFile.py +++ b/updateHostsFile.py @@ -1061,7 +1061,7 @@ def normalize_rule(rule, target_ip, keep_domain_comments): """ first try: IP followed by domain """ - regex = r"^\s*(\d{1,3}\.){3}\d{1,3}\s+((?:\w+\.)+[a-zA-Z]+)(.*)" + regex = r"^\s*(\d{1,3}\.){3}\d{1,3}\s+([\w\.-]+[a-zA-Z])(.*)" result = re.search(regex, rule) if result: @@ -1090,7 +1090,7 @@ def normalize_rule(rule, target_ip, keep_domain_comments): """ # deny any potential IPv6 address here. if ":" not in rule: - regex = r"^\s*((?:\w+\.)+[a-zA-Z]+)(.*)" + regex = r"^\s*([\w\.-]+[a-zA-Z])(.*)" result = re.search(regex, rule) if result: