Is it possible to move the preg_match search below into the JMESPATH search filter using contains? I found an example of contains in the JMESPATH tutorial, but I'm not sure if the syntax supports combining filter strings somehow using OR.
$s3_results = $s3_client->getPaginator('ListObjects', ['Bucket' => $config['bucket']]);
// Narrow S3 list down to files containing the strings "css_" or "js_".
foreach ($s3_results->search('Contents[].Key') as $key) {
if (preg_match("/(css_|js_)/", $key)) {
$s3_keys[] = $key;
}
}