Hello,
Select everything from this area of your tags when you run the page through your eregi parsing (selected region indicated within brackets):
<a href="[http://www.domain.com">Some text]</a>
This will give you:
http://www.domain.com">Some text
Then, you can separate these two elements using explode:
$links[$i] = explode("\">", $links[$i]);
This should give you an array of links where the [0] key holds the url and the [1] key holds the text that belongs to it.
i.e.
foreach ($links AS $link) {
echo "url: " . $link[0] . " -- txt: " . $link[1] . "<br>";
} //end foreach
This also limits the amount of regexp processing you do, which is always important to consider. You should consider being more strict with your regexp matching and not check for whitespace before and after the = character (it shouldn't be there anyway). If you need to check for it, use [ ], which will only look for a space character and not tabs, line breaks, etc. as the [[:space:]] pattern does. Just conjecture...