def get_key_from_line(line):
    """
    Tries to extract the key from the line

    :param line: unicode string
    :return: unicode string: the key or None
    """
    if line.find("#") != 0 or line.find("!") != 0:
        index_key_end = line.find("=")
        while (index_key_end > 0) and (line[index_key_end - 1] == "\\"):
            index_key_end = line.find("=", index_key_end + 1)
        if index_key_end > 0:
            return line[0:index_key_end].strip()
    return None