import re


def exclude(images, excludes, verbose):
    """Return the images that don't match the regexes in the excludes list."""
    remaining_images = images.copy()
    regexes = [re.compile(r) for r in excludes]
    # pylint: disable=invalid-name
    for (Id, image) in images.items():  # noqa: N806
        for tag in image.tags:
            for r in regexes:
                if r.match(tag):
                    if verbose:
                        print(f"Excluding image {Id}.")
                    remaining_images.pop(Id)
                    break
    return remaining_images