def feature_list_latest(feature_selection_df, method=None, max_features=None, 
                          notes_contains=None, return_df = False, split_char='---'):
    """Given a log of feature lists, return the latest feature list.
        Optionally filter by method, max number, note regex search.
        Assumes feature list is contained in column 'Features' and joined by specific
        string character pattern
        Order of filtering goes: method --> max number of features --> notes
    Parameters
    ----------
    feature_selection_df : Pandas DataFrame
        A dataframe log of feature selection lists.
        Must have columns: ['Date', 'Method', 'Number_of_Features', 'Notes', 'Features']
    method : str
        A feature selection method name. Searches df column 'Method' for a match
    max_features : int
        The maximum number of features to have in a feature list
    notes_contains: str
        A string to search the notes for when filtering
    return_df: Boolean
        Flag to return the feature list df rather than latest feature list
        Default is False        
    split_char : str
        The string character pattern the feature list is joined together on.
    Returns
    -------
    latest_flist: list
        A list of the latest feature list matching the filtering criteria
    feature_selection_df: Pandas DataFrame
        A dataframe of feature lists filtered by the given criteria
    """
    if method:
        ## Filter by method
        feature_selection_df = feature_selection_df[feature_selection_df.Method == method]
    if max_features:
        ## Filter by max number of features
        feature_selection_df = feature_selection_df[feature_selection_df.Number_of_Features <= max_features]
    if notes_contains:
        ## Filter by notes containing
        feature_selection_df = feature_selection_df[feature_selection_df.Notes.str.contains(notes_contains)]  
    ## If the dataframe isn't empty
    if feature_selection_df.shape[0] != 0:
        if return_df:
            return feature_selection_df
        else:
            # Return the last appearing feature list in the df and split features by split character
            latest_flist = feature_selection_df.iloc[feature_selection_df.shape[0]-1, :].Features.split(split_char)
            return latest_flist
    else:
        return print('No feature list with specified filters found')