From fe77f87110f249fad10b1a2bb71bdebec398c1da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Sun, 5 Mar 2023 14:24:51 +0800 Subject: [PATCH] Fixed a regular expression in the _parse_period_spec function of the period utility. --- src/accounting/report/period.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/accounting/report/period.py b/src/accounting/report/period.py index 768d98c..52cd2bc 100644 --- a/src/accounting/report/period.py +++ b/src/accounting/report/period.py @@ -498,7 +498,7 @@ def _parse_period_spec(text: str) \ m = re.match(r"^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?-$", text) if m is not None: return __get_start(m[1], m[2], m[3]), None - m = re.match(r"-^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$", text) + m = re.match(r"-(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$", text) if m is not None: return None, __get_end(m[1], m[2], m[3]) m = re.match(r"^(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?-(\d{4})(?:-(\d{2})(?:-(\d{2}))?)?$", text)