I need to go with this:
/(<img[^>]*src=".*?(?:pre\.gif|next\.gif)"[^>]*>)/i
Or in PHP:
$regexp = '/(<img[^>]*src=".*?(?:pre\.gif|next\.gif)"[^>]*>)/i';
$iResults = preg_match_all($regexp, $str, $aMatches);
print_r($aMatches);
- change: Sorry. I made a mistake. .in pre.gifand next.gifin regexp the regex must be escaped !! I didn’t do this before. - edit
PS. You may be using preg_match_all incorrectly. Arguments are: ( pattern, subject, &matches)
PS. My template results + your item:
Array
(
[0] => Array
(
[0] => <img border="0" alt="icon" src="http://www.site.com/images/pre.gif" width="90" height="v">
[1] => <img border="0" alt="icon" src="http://www.site.com/images/next.gif" width="90" height="90">
)
[1] => Array
(
[0] => <img border="0" alt="icon" src="http://www.site.com/images/pre.gif" width="90" height="v">
[1] => <img border="0" alt="icon" src="http://www.site.com/images/next.gif" width="90" height="90">
)
)