I'm trying to use preg_match_all
to scan the source of a page and pull all links that are mailto: links into one array and all links that are not mailto: links into another array. Currently I'm using:preg_match_allを使用してすべて<a href links that are NOT mailto: links
$searches = array('reg'=>'/href(=|=\'|=\")(?!mailto)(.+)\"/i','mailto'=>'/href(=|=\'|=\")(?=mailto)(.+)\"/i');
foreach ($searches as $key=>$search)
{
preg_match_all($search,$source,$found[$key]);
}
The mailto: links search is working perfectly, but I can't find the reason why the non mailto: link search is pulling both mailto: and non-mailto: links, even with the negative look ahead assertion in place. What am I doing wrong?
と一致するように '
"mailto:
'に対して失敗しません[** The pony、彼は来ます**](http://stackoverflow.com/questions/1732348/regex-match-open-tags -except-xhtml-self-contained-tags/1732454#1732454) - [X] HTMLの正規表現解析が悪い考えである理由の標準的な参照 – rdlowrey