import re


def detect_patient_age(info_par):
    """Returns age of patient described in paragraph of WHO assessment"""
    # Searches for "year-old" or 'year old'
    if re.findall('(\d{1,2}) ?(:?-?(year|month)(-| )old)',info_par) != []:
        age = re.findall('(\d{1,2}) ?(:?-?(year|month)(-| )old)',info_par)[0][0]
    else:
        age = 'unknown'
    return(age)