$re = '/<a\s+(?:href|title)=[^>]*>([^<]*)<\/a>/';
$str = '<a href=\\\\\\"http://www.dfs.ny.gov/\\\\\\">www.dfs.ny.gov</a>, for free information on comparative credit card rates, fees and grace periods. </span>";
<a title= "some title" href=\\\\\\"http://www.dfs.ny.gov/\\\\\\">www.dfs.ny.gov</a>, for free information on comparative credit card rates, fees and grace periods. </span>";
<a nottitle= "some title" href=\\\\\\"http://www.dfs.ny.gov/\\\\\\">www.dfs.ny.gov</a>, for free information on comparative credit card rates, fees and grace periods. </span>";
<a id=\\"OLE_LINK2\\" class=\\"bookmark\\" title=\\"OLE_LINK2\\" name=\\"OLE_LINK2\\"></a>
';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php