My regex skill is... bad. I have this email body.
Hello World
[cid:[email protected]]
Hello World
[cid:[email protected]] [cid:[email protected]]
Hello World
And what I need is an array of the filenames.
preg_match_all("/\[cid:(.*)\@/", $string, $matches);
echo "<pre>";
print_r($matches);
echo "</pre>";
And I get the first filename fine. But not the 2nd and 3rd.
[0] => image002.png
[1] => [email protected]] [cid:image002.png
How can I change this regex so it works for any embedded file in an email body?