preg_match_all("'<\s*a\s.*?href\s*=\s* # find <a href=
([\"\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\s\>]+)) # ifquote found, match up to next matching
# quote, otherwise match up to next space
'isx",$document,$links);
这是snoopy.class.php里面 在文档中取得所有连接的正则,有些地方也是看不懂,希望大虾给解释一下,谢谢。
([\"\'])? # find single or double quote
(?(1) (.*?)\\1 | ([^\s\>]+)) # if quote found, match up to next matching
# quote, otherwise match up to next space
'isx",$document,$links);