import re


def _get_hst_var(filename):
    """Read variable names from history file

    Parameters
    ----------
    filename : string
        Name of the file to open, including extension

    Returns
    -------
    vlist : list
        List of variables
    """

    with open(filename, 'r') as f:
        # For the moment, skip the first line which contains information about
        # the volume of the simulation domain
        # "Athena history dump for level=.. domain=0 volume=..."
        # "#   [1]=time      [2]=dt         [3]=mass ......"
        h = f.readline()
        h = f.readline()

    vlist = re.split("\[\d+]\=|\n", h)
    for i in range(len(vlist)):
        vlist[i] = re.sub("\s|\W", "", vlist[i])

    return vlist[1:-1]