$re = '/(?<=;\/wp-content\/uploads\/)(.*?)(?=\.jpg)/m';
$str = '<div class="js-aem-gallery" data-images></div>
<div class="js-aem-gallery" data-images="{"omniture":{"type":"","hasImpression":false},"slides":[{"title":"","omniture":null,"description":"","path":"/wp-content/uploads/auto-shows/frankfurt/2017/2019-porsche-cayenne/02-2019-porsche-cayenne-turbo-NP.jpg","thumbnail":"/wp-content/uploads/auto-shows/frankfurt/2017/2019-porsche-cayenne/02-2019-porsche-cayenne-turbo-NP.jpg?w=320&h=240&crop=1"},{"title":"","omniture":null,"description":"","path":"/wp-content/uploads/make/porsche/cayenne/2019/oem/21-2019-porsche-cayenne.jpg","thumbnail":"/wp-content/uploads/make/porsche/cayenne/2019/oem/21-2019-porsche-cayenne.jpg?w=320&h=240&crop=1"},{"title":"","omniture":null,"description":"","path":"/wp-content/uploads/make/porsche/cayenne/2019/oem/23-2019-porsche-cayenne.jpg","thumbnail":"/wp-content/uploads/make/porsche/cayenne/2019/oem/23-2019-porsche-cayenne.jpg?w=320&h=240&crop=1"},{"title":"","omniture":null,"description":"","path":"/wp-content/uploads/make/porsche/cayenne/2019/oem/30-2019-porsche-cayenne.jpg","thumbnail":"/wp-content/uploads/make/porsche/cayenne/2019/oem/30-2019-porsche-cayenne.jpg?w=320&h=240&crop=1"}]}"></div>';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php