The format of what I am trying to match may look like the following:
<a href="some.mpg"><img src="some.jpg"></a>
My problem is that other tags may be present. Also the html code may span multiple lines. I am only interested in the link to the media file and the source image of the image tag.
My current regex is:
Code: Select all
preg_match_all("#<a.*href=[\"\'](.*)(.mpg|.mpeg|.mov|.avi|.wmv)[\"\'].*>.*<img.*src=[\"\'](.*)(.jpg|.jpeg)[\"\'].*>.*</a>#is", $fileContents, $matches, PREG_SET_ORDER);Can anyone provide some advice?
Cheers
Jason