diff --git a/qubesmanager/firewall.py b/qubesmanager/firewall.py index 1639a42..8db6ba8 100644 --- a/qubesmanager/firewall.py +++ b/qubesmanager/firewall.py @@ -49,7 +49,7 @@ class QIPAddressValidator(QtGui.QValidator): hostname = unmask[0] mask = unmask[1] if mask.isdigit() or mask == "": - if re.match("^([0-9]{1,3}\.){3}[0-9]{1,3}$", hostname) is None: + if re.match(r"^([0-9]{1,3}\.){3}[0-9]{1,3}$", hostname) is None: return (QtGui.QValidator.Invalid, input, pos) if mask != "": mask = int(unmask[1]) @@ -64,7 +64,7 @@ class QIPAddressValidator(QtGui.QValidator): if hostname[-1:] == "-": return (QtGui.QValidator.Intermediate, input, pos) - allowed = re.compile("(?!-)[A-Z\d-]{1,63}(?[a-z][a-z0-9-]+)\s+(?P[0-9]+)/(?P[a-z]+)", + r"(?P[a-z][a-z0-9-]+)\s+(?P[0-9]+)/" + r"(?P[a-z]+)", re.IGNORECASE) file = open('/etc/services', 'r') for line in file: