Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Fixing dates - 4

from date import test_date
import re

def fix_date4(date):
    return re.sub(r'-(\d)\b', r'-0\1', date)

test_date(fix_date4)

Output:

Everything looks good