import re


def parse_run_id_for_batch(batch_file):
    """
    Parse the run id (YYMMDD_D00565_####_FCID) from a path to a batch file.
    """
    name_parts = batch_file.split('/')
    try:
        return [p for p in name_parts if re.match("^[0-9]+_.+_.+_.+(X(X|Y|2|3|F)|(-C[A-Z0-9]{4})|(A[0-9a-zA-Z]+(M5|HV)))$", p)][0]
    except IndexError:
        return "Could not determine."