Home  >  Article  >  Backend Development  >  求正则表达式。解决思路

求正则表达式。解决思路

WBOY
WBOYOriginal
2016-06-13 13:42:49809browse

求正则表达式。

PHP code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

--><span class="site-span"><a href="http://chongqing.lashou.com/" target="_blank" title="该网站支持百度帐号一站通登录" mon="ipcity=重庆&position=famous&type=site&sitename=拉手网">拉手网</a>
</span>

我想匹配
http://chongqing.lashou.com/
拉手网

这两个结果,我写的正则表达式为
C# code
<!--

Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/

-->
        $regular    =    '/<a>]* href="([^"]*)"[^>]*>(.*)/isU';

</a>


但是匹配出来的结果是错的误的。

------解决方案--------------------
preg_match_all('#print_r($arr);
------解决方案--------------------
preg_match_all('#print_r($arr);
------解决方案--------------------
preg_match_all('#print_r($arr);
------解决方案--------------------
preg_match_all('#(.*)#',$url,$arr);
print_r($arr);
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn