def matches(string, patterns):
    """
    Filters out objects in `patterns` that do not match with `string`.
    
    args:
        string: a str to match against `patterns`
        patterns: an iterable of objects implementing a `match` method
    
    returns:
        a list of objects in `patterns` that match `string`
    """
    
    return [obj for obj in patterns if obj.match(string)]