def filter_entries_by_tag(search, entry):
    """Check if search matches any tags as stored in the Entry namedtuple
       (case insensitive, only whole, not partial string matches).
       Returns bool: True if match, False if not.
       Supported searches:
       1. If & in search do AND match,
          e.g. flask&api should match entries with both tags
       2. Elif | in search do an OR match,
          e.g. flask|django should match entries with either tag
       3. Else: match if search is in tags
    """
    Truth = []
    
    search = search.lower()
    
    if '&' in search:
        for term in search.split('&'):
            Truth.append(term.lower() in entry.tags)
        return all(Truth)
        
    elif '|' in search:
        for term in search.split('|'):
            Truth.append(term.lower() in entry.tags)
        return any(Truth)
            
    else:
        return search.lower() in entry.tags
    pass