<?php $blah='test case: https://www.example.com/media/foo/bar.jpg https://www.example.com/media/cat/fish.jpg some text'; $image = 'fish.jpg'; $your_pattern = '/https:\/\/www\.example\.com\/media(.*)\/'.preg_quote($image).'/'; echo preg_match($your_pattern,$blah,$matches)?$matches[0]:'fail'; echo "\n----\n"; $my_pattern='~https://www\.example\.com/media(?:[^/\s]*/)+'.preg_quote($image).'~'; echo preg_match($my_pattern,$blah,$out)?$out[0]:'fail';
You have javascript disabled. You will not be able to edit any code.
Value for `_results` contains invalid data `array`