import re


def is_assay_or_study(collection):
    """
    Check if a given collection matches the format of path to a study or assay
    collection.
    """
    return re.match(
        r'(assay|study)_[a-f0-9]{8}-([a-f0-9]{4}-){3}[a-f0-9]{12}',
        collection.name,
    )