Fixing dates - 3



examples/regex/fix_date3.py
from date import test_date
import re

def fix_date3(date):
    return re.sub(r'-(\d)(-|$)', r'-0\1\2', date)

test_date(fix_date3)

      old: 2010-7-5
      new: 2010-07-5
 expected: 2010-07-05