I have a variable $content that contains some text and images in this form (unknown amount of images):
text text text text
Using regex:
text text text text
text text text text text text text text text text text text text text text text 
text text text text
';
preg_match_all('@/]*/?>@Ui', $str, $out);
print_r($out[1]);
?>
Output:
Array
(
[0] => path/to/image/1
[1] => path/to/image/2
[2] => path/to/image/3
[3] => path/to/image/4
[4] => path/to/image/5
)