def date_match(line, pattern):
    """
    If line matches pattern then return the date as an integer, else None.
    """
    match = pattern.match(line)
    if match:
        d = "".join([m for m in match.groups() if m])
        while len(d) < 12:
            d = d + "00"

        dt = int(d)
        return dt
    return