'Caclculate age in months from a string in CHILDES format'

def convert_age(self, age_year):

    m = re.match('P(\\d+)Y(\\d+)M?(\\d?\\d?)D?', age_year)
    age_month = ((int(m.group(1)) * 12) + int(m.group(2)))
    try:
        if (int(m.group(3)) > 15):
            age_month += 1
    except ValueError as e:
        pass
    return age_month
