Fix escape sequences

This commit is contained in:
Guillaume Ayoub 2018-10-26 15:18:49 +02:00
parent 4fe4410485
commit efd42751cc
1 changed files with 9 additions and 9 deletions

View File

@ -350,22 +350,22 @@ def strip_whitespace(string):
W3C_DATE_RE = re.compile('''
^
[ \t\n\f\r]*
(?P<year>\d\d\d\d)
(?P<year>\\d\\d\\d\\d)
(?:
-(?P<month>0\d|1[012])
-(?P<month>0\\d|1[012])
(?:
-(?P<day>[012]\d|3[01])
-(?P<day>[012]\\d|3[01])
(?:
T(?P<hour>[01]\d|2[0-3])
:(?P<minute>[0-5]\d)
T(?P<hour>[01]\\d|2[0-3])
:(?P<minute>[0-5]\\d)
(?:
:(?P<second>[0-5]\d)
(?:\.\d+)? # Second fraction, ignored
:(?P<second>[0-5]\\d)
(?:\\.\\d+)? # Second fraction, ignored
)?
(?:
Z | # UTC
(?P<tz_hour>[+-](?:[01]\d|2[0-3]))
:(?P<tz_minute>[0-5]\d)
(?P<tz_hour>[+-](?:[01]\\d|2[0-3]))
:(?P<tz_minute>[0-5]\\d)
)
)?
)?