def mirror_search_terms(terms):
    """
    Interchange the sidedness of a query
    :param terms: List of strings matching (H|L)[0-9]+(l|r)? 
                  <has/lacks><ringid>[<left/right>]
    :return: The same terms with occurrences of 'left' and 'right' interchanged
    """
    terms = [term.replace('l', 'Q').replace('r', 'l').replace('Q', 'r') for term in terms]
    return terms