Without using a full blown parser, this may do the trick for most situations...
$str = 'http://google.com';
$regex = '/(?google.com"
It uses a negative lookbehind to make sure there is no href=" or href=' preceding it.
See it on IDEone.
It also takes into account people who delimit their attribute values with '.