Help with REGEX (<a> and <img>)

Hi,

i need a regex func to do the following :

$article is a variable contains normal text ,textual link and image links(<img>)

()
the func should add (http://site.com/) to the <a> tag before the the original link in href ,IF the <a> tag DOESN’T contain <img> tag.

e.g :
<a> with <img>:

<a href="http://google.com/" target="_blank"><img src="http://google.com/logo.png" /></a>

textual <a> without <img>:

<a href="http://google.com/" target="_blank">normal text</a>

please help .!

bottom line :

parse $article , if the <a> tag contains <img> then DO NOT add (http://site.com/) before the the original link in href.

else , if the <a> DOES NOT contains <img> then add (http://site.com/) before the the original link in href.