If this is the string
example
$str = 'this is a string of chars <a href="http://www.asd.com\">Anchor Text</a>';
i am doing this method to clean the input
$res = get_magic_quotes_gpc() ? stripslashes($str) : $str;
$res = mysql_real_escape_string($res);
and this code to extract url
preg_match('#href\s*?=\s*?[\'"]?([^\'"]*)[\'"]?#i', $input, $captures);
$href = $captures[1];
But i come up with this result
"\"http://www.asd.com\""
string with 2 double quotes and backslash.
where i want that
Simply, do not use regexp. It takes long to create and even longer to debug.
http://codepad.org/w370PJoz