import re


def process_history(post_hist : list) -> dict:
    """Parses history metadata for title, date, student uid, and creation date.
    :param post_hist: post history 
    :returns: dictionary with relevant history data pulled.
    """
    hist_result = {}
    init_post = post_hist[-1]
    hist_result["student uid"] = init_post["uid"]

    # Fetch creation date and convert from m-dd to m/dd form
    date = init_post["created"]
    hist_result["date posted"] = date[6:7] + "/" + date[8:10]
    subject = post_hist[0]["subject"]

    # Date of section, in m/dd format
    sect_date = re.search("([678]{1}\/\d+)", subject)
    sect_date = sect_date.group() if sect_date else "Error"
    if sect_date[2] == "0":
        sect_date = sect_date[:2] + sect_date[3:]

    hist_result.update({"section date": sect_date, "title": subject})
    return hist_result