import re


def match_filter(device_filter='all', device_name=''):
    """
    Compare device name to device_filter

    Parameters
    ----------
    device_filter : str, optional
        Filter to test device name, by default 'all'
    device_name : str,
        Name of the device.

    Returns
    -------
    bool
        True if match filter, False otherwise.
    """
    if re.search(r"\ball\b", str(device_filter)) or (
       any(element in device_name for element in device_filter)):
        return True
    return False