summaryrefslogtreecommitdiff
path: root/src/isodate/isodates.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/isodate/isodates.py')
-rw-r--r--src/isodate/isodates.py12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/isodate/isodates.py b/src/isodate/isodates.py
index 37d42f8..6660245 100644
--- a/src/isodate/isodates.py
+++ b/src/isodate/isodates.py
@@ -87,21 +87,15 @@ def build_date_regexps(yeardigits=4, expanded=False):
% (sign, yeardigits)))
# 3. ordinal dates:
# YYYY-DDD or +-YYYYYY-DDD ... extended format
- cache_entry.append(re.compile(r"(?P<sign>[+-]){%d}(?P<year>[0-9]{%d})"
- r"-(?P<day>[0-9]{3})"
- % (sign, yeardigits)))
# YYYYDDD or +-YYYYYYDDD ... basic format
cache_entry.append(re.compile(r"(?P<sign>[+-]){%d}(?P<year>[0-9]{%d})"
- r"(?P<day>[0-9]{3})"
+ r"-?(?P<day>[0-9]{3})"
% (sign, yeardigits)))
# 4. week dates:
# YYYY-Www or +-YYYYYY-Www ... extended reduced accuracy week date
- cache_entry.append(re.compile(r"(?P<sign>[+-]){%d}(?P<year>[0-9]{%d})"
- r"-W(?P<week>[0-9]{2})"
- % (sign, yeardigits)))
# YYYYWww or +-YYYYYYWww ... basic reduced accuracy week date
- cache_entry.append(re.compile(r"(?P<sign>[+-]){%d}(?P<year>[0-9]{%d})W"
- r"(?P<week>[0-9]{2})"
+ cache_entry.append(re.compile(r"(?P<sign>[+-]){%d}(?P<year>[0-9]{%d})"
+ r"-?W(?P<week>[0-9]{2})"
% (sign, yeardigits)))
# 5. month dates:
# YYY-MM or +-YYYYYY-MM ... reduced accuracy specific month