def matches_filter(val, op, required_value):
    """
    check if table content matches filtered value

    Parameters
    ------------
    val : str
        value from registry table to be compared
    op : str
        filtering operation to be performed
    required_value : str
        value to match from filter_expression

    Returns
    --------
    bool
        return TRUE if vtable content matches filtered value, FALSE otherwise
    """

    if op == "==":
        return val == required_value
    elif op == "!=":
        return val != required_value
    elif op == "contains":
        return required_value in val
    elif op == "not contains":
        return required_value not in val
    else:
        assert False, op