def replace_u(matchobj):
    """Break the interval into parts, and replace 'u's.

    pieces - [pos/neg, start_year, start_month, start_day,
              pos/neg, end_year, end_month, end_day]
    """
    pieces = list(matchobj.groups(''))
    # Replace "u"s in start and end years.
    if 'u' in pieces[1]:
        pieces[1] = pieces[1].replace('u', '0')
    if 'u' in pieces[5]:
        pieces[5] = pieces[5].replace('u', '9')
    # Replace "u"s in start month.
    if 'u' in pieces[2]:
        pieces[2] = '-' + replace_u_start_month(pieces[2])
    # Replace "u"s in end month.
    if 'u' in pieces[6]:
        pieces[6] = '-' + replace_u_end_month(pieces[6])
    # Replace "u"s in start day.
    if 'u' in pieces[3]:
        pieces[3] = '-' + replace_u_start_day(pieces[3])
    # Replace "u"s in end day.
    if 'u' in pieces[7]:
        pieces[7] = '-' + replace_u_end_day(pieces[7], year=pieces[5],
                                            month=pieces[6])
    return ''.join((''.join(pieces[:4]), '/', ''.join(pieces[4:])))
Break the interval into parts, and replace 'u's.

    pieces - [pos/neg, start_year, start_month, start_day,
              pos/neg, end_year, end_month, end_day]