import re


def get_files_that_match(vdp, folder, regex):
    """Get all files in a folder that match a regex"""

    out = []

    for file in vdp.ls(folder):
        match = re.match(regex, file)

        if match:
            out.append((folder, file, match.groupdict()))

    return out