I agree with Gordon, you MUST use an HTML parser to parse HTML. But if you really want a regex you can try this one :
/^
This matches at the begining of the string, followed by any number of any char (non greedy) .*?
then href=
followed by the link surrounded by either "
or '
$str = 'what?';
preg_match('/^
Output:
array(3) {
[0]=>
string(37) "what?"
[1]=>
string(1) """
[2]=>
string(4) "that"
}