def filter_meta(pattern, metatags):
    """ Filter METADATA_FIELDS from unused tags."""
    used_tags = set()
    for metatag in metatags:
        if '{' + metatag + '}' in pattern:
            used_tags.add(metatag)
    return used_tags
