populates file_names list with urls that matched the regex match object
    returns the total filesize of all the files matched

def get_s3_uri(m, file_names, config):
    """
    populates file_names list with urls that matched the regex match object
    returns the total filesize of all the files matched
    """
    bucket_name = m.group(1)
    path = m.group(2)
    bucket = get_s3_bucket(bucket_name, config)
    result = 0
    if (config.start_date or config.date_range) and ("{year" in path or "{month" in path or "{day" in path):
        for tmp_date in date_generator(config.end_date, config.date_range or ((config.end_date - config.start_date).days + 1)):
            # +1 because we want to include end_date
            for key in bucket.list(prefix=path.format(year=tmp_date.year, month=tmp_date.month, day=tmp_date.day)):
                file_names.append("s3://{}/{}".format(bucket_name, key.name))
                result += key.size
    else:
        for key in bucket.list(prefix=path):
            file_names.append("s3://{}/{}".format(bucket_name, key.name))
            result += key.size
    return result