I'll be nice and share one regexp
This grabs all linked images on a page:
PHP Code:
/<a.*href=[\"|\']([^\"|^\'|^\s]+)[\"|\'].*><img.*src=[\"|\']([^\"|^\'|^\s]+)[\"|\'].*><\/a>/im
In PHP, do it like this:
PHP Code:
preg_match_all("/<a.*href=[\"|\']([^\"|^\'|^\s]+)[\"|\'].*><img.*src=[\"|\']([^\"|^\'|^\s]+)[\"|\'].*><\/a>/im", $string, $matches)
$matches is an array with all of the images with links. Just change up the regexp for plain links, images, etc.