def get_name_from_actions(regex, actions: list):
    """
    Return the name from a set of actions, using a regular expression.
    :param regex:  The regular expression to be used.
    :param actions:  The list of actions
    :return:  The NAME parameter from the regular expression, or None
    """
    for action in actions:
        assert 1 == len(action)
        lines = action[list(action.keys())[0]]
        for line in lines:
            if isinstance(line, str):
                m = regex.match(line)
                if m:
                    groupdict = m.groupdict()
                    if 'NAME' in groupdict:
                        return groupdict['NAME']
            else:
                assert isinstance(line, dict), "Bad entry in action list"
    return None