To match multiple A-label joins and first-name regular expressions

Source: Internet
Author: User
To match multiple A-label joins and name regular expressions
such as the source code

Knowledge Whipple News China Journal Network Dragon Source Journal Network Postal News Subscription Network magazine shop MBA think-tank Encyclopedia star Astronomy Network an exhortation net
Pastoral Astronomy Forum Patent Home Global Science Science Squirrel will UFO exploration network shell NET I study net NetEase open Class
Wikipedia I want to self-study network China Study Network to know the NetEase College search and ask beginners to learn the Internet National Nuclear Safety Bureau


Alas, I'm embarrassed

I asked this question recently, but there was a lot of good-hearted people who helped me out when there was only one a tag. Http://topic.csdn.net/u/20111216/16/934599d3-8e99-4b94-8dae-28e5b9c455c4.html
But now that it's multiple a-tag, I'm going to make a mistake.
Also please expert guidance. How should I get it?


------Solution--------------------
Preg_match_all ('/(. *)foreach ($matches [1] as $k = + $href) {
$arr [$matches [2][$k]] = $href;
}
Var_export ($arr);
/**
Output Result:
Array (' whipple info ' = ' http://www.cqvip.com/', ' Chinese journal net ' = ' http://www.chinaqking.com/', ' Dragon Source Journal ' www.qikan.com.cn/', ' Postal newspaper subscription network ' + ' Http://bk.183.com.cn/index.do ', ' Magazine shop ' + ' http://www.zazhipu.com/', ' MBA think tank Encyclopedia ' = ' http://wiki.mbalib.com/', ' star astronomy net ' = ' http://www.cosmoscape.com/', ' an exhortation net ' = ' http://www.quanxue.cn/', ' The Pastoral Astronomy Forum ' = ' http://www.astronomy.com.cn/bbs/', ' patent house ' = ' http://www.patent-cn.com/', ' Global science ' +/HTTP www.sciam.com.cn/', ' Science Squirrel will ' and ' http://songshuhui.net/', ' UFO discovery net ' = ' http://www.ufo-1.cn/', ' shell net ' = '/' www.guokr.com/', ' I learn the net ' and ' http://www.5xue.com/', ' netease open class ' = ' http://v.163.com/open/', ' wikipedia ' = '/' zh.wikipedia.org/', ' I want to self-study net ' and ' http://www.51zxw.net/', ' chinese study net ' = ' http://www.cscse.edu.cn/', ' Know ' and ' ' and ' http:/' /www.zhihu.com/', ' NetEase College ' and ' http://tech.163.com/school/video/', ' Search and ask ' and ' http://wenwen.soso.com/', ' novice learning online ' = > ' http://xue.baidu.com/', ' National Nuclear Safety Agency ' and ' http://nnsa.mep.gov.cn/',' Word alliance ' = ' http://www.wordlm.com/', ' love to ask knowledge people ' = ' http://iask.sina.com.cn/', ' Chinese civilization net ' www.wenming.cn/',)

PS: Once achieved, there seems to be no way.
*/

------Solution--------------------
 
  $str = ' Knowledge Whipple information China Journal Network Dragon Source Journal Network Postal News Subscription Network magazine shop MBA think-tank Encyclopedia star Astronomy Network an exhortation net
Pastoral Astronomy Forum Patent Home Global Science Science Squirrel will UFO exploration network shell NET I study net NetEase open Class
Wikipedia I want to self-study network China Study Network to know the NetEase College search and ask beginners to learn the Internet National Nuclear Safety Bureau
Word Alliance love to ask Knowledge people Chinese civilization network ';
$patten = '/(. *) <\/a>/iu ';
Preg_match_all ($patten, $str, $match);
$result = Array ();
  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.