import re


def _filter_zones(wanted_zones_prefix, zone_list):
    """Filter unwanted zones from a zone list using a prefix."""
    target_zones = []

    for zone in zone_list:
        for prefix in wanted_zones_prefix:
            pattern = re.compile(f'^{prefix}')
            if pattern.match(zone):
                target_zones.append(zone)

    return target_zones