diff --git a/fail2ban/server/iso8601.py b/fail2ban/server/iso8601.py index a53557fb..a28ce13b 100644 --- a/fail2ban/server/iso8601.py +++ b/fail2ban/server/iso8601.py @@ -41,7 +41,7 @@ __all__ = ["parse_date", "ParseError"] # Adapted from http://delete.me.uk/2005/03/iso8601.html ISO8601_REGEX_RAW = "(?P[0-9]{4})-(?P[0-9]{1,2})-(?P[0-9]{1,2})" \ "T(?P[0-9]{2}):(?P[0-9]{2})(:(?P[0-9]{2})(\.(?P[0-9]+))?)?" \ - "(?PZ|(([-+])([0-9]{2}):([0-9]{2})))?" + "(?PZ|[-+][0-9]{2}(:?[0-9]{2})?)?" ISO8601_REGEX = re.compile(ISO8601_REGEX_RAW) TIMEZONE_REGEX = re.compile("(?P[+-])(?P[0-9]{2}):?(?P[0-9]{2})?")