diff options
author | gweis <gerhard.weis@gmail.com> | 2015-04-01 13:23:42 +1000 |
---|---|---|
committer | gweis <gerhard.weis@gmail.com> | 2015-04-01 13:23:42 +1000 |
commit | 9a9c755b630e803bc070f4a397cded14a8a20dbb (patch) | |
tree | 5d1463d7be233f3f3dccceb5634c9101c3c21597 | |
parent | 548fa43cf886702489b3e7e5fb1afdfab8f8577d (diff) | |
parent | 53b2053045f05669b5889713c98c45e77635bea6 (diff) | |
download | isodate-9a9c755b630e803bc070f4a397cded14a8a20dbb.tar.gz |
Merge pull request #18 from Polyconseil/fbochu/iso8601-period-regexp
Fix ISO8601_PERIOD_REGEX to not match 'P'
-rw-r--r-- | src/isodate/isoduration.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/isodate/isoduration.py b/src/isodate/isoduration.py index 5d51441..6da69f5 100644 --- a/src/isodate/isoduration.py +++ b/src/isodate/isoduration.py @@ -41,7 +41,8 @@ from isodate.isostrf import strftime, D_DEFAULT ISO8601_PERIOD_REGEX = re.compile( r"^(?P<sign>[+-])?" - r"P(?P<years>[0-9]+([,.][0-9]+)?Y)?" + r"P(?!\b)" + r"(?P<years>[0-9]+([,.][0-9]+)?Y)?" r"(?P<months>[0-9]+([,.][0-9]+)?M)?" r"(?P<weeks>[0-9]+([,.][0-9]+)?W)?" r"(?P<days>[0-9]+([,.][0-9]+)?D)?" |