$re = '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i'; I am using this regular expression to match all image files, now i need to filter based on domain name. for example, i want to get all images contain "yahoo.com". http://yahoo.com/image/1.jpg I rewrote this RE, but its working. please help me out. $re = '/<img.+src=[\'"]([^\'"]+)(yahoo.com)([^\'"]+)[\'"].*>/i';