need some help with this bit of pregmatch where I want to look for a specific filetype (jpg, jpeg, png). Any help would be appreciated.
The code:
$strmatch='^\s*(?:<p.*>)?\<a.*href="(.*)">\s*(<img.*src=[\'"].*[\'"]\s*?\/?>)[^\<]*<\/a\>\s*(.*)$';
if (preg_match("/$strmatch/sU", $content, $matches)) {
$leadMatch=1;
}
Right now it does as it is supposed to and returns images, but I want to be able to set image type (ie make it so it doesn't look for .gif)
Thx in advance.
EDIT: Alternatively could it be possible to insert a specific img alt tag to look for, for example alt="thisImage"?