Commits

Mike Fogel  committed 14c616d

Tighten up regex for microseconds in parse()

  • Participants
  • Parent commits 851a2c3

Comments (0)

Files changed (1)

File timedelta/helpers.py

     # This is the format we get from sometimes Postgres, sqlite,
     # and from serialization
     d = re.match(r'((?P<days>\d+) days?,? )?(?P<hours>\d+):'
-                 r'(?P<minutes>\d+)(:(?P<seconds>[\.\d]+))?',
+                 r'(?P<minutes>\d+)(:(?P<seconds>\d+(\.\d+)?))?',
                  unicode(string))
     if d: 
         d = d.groupdict(0)