/**
* Deletes objects from Amazon S3 that match the result of a ListObjects operation. For example, this allows you
* to do things like delete all objects that match a specific key prefix.
*
* @param string $bucket Bucket that contains the object keys
* @param string $prefix Optionally delete only objects under this key prefix
* @param string $regex Delete only objects that match this regex
* @param array $options Options used when deleting the object:
* - before_delete: Callback to invoke before each delete. The callback will receive a
* Guzzle\Common\Event object with context.
*
* @see Aws\S3\S3Client::listObjects
* @see Aws\S3\Model\ClearBucket For more options or customization
* @return int Returns the number of deleted keys
* @throws RuntimeException if no prefix and no regex is given
*/
public function deleteMatchingObjects($bucket, $prefix = '', $regex = '', array $options = [])
{
return $this->instance->deleteMatchingObjects($bucket, $prefix, $regex, $options);
}