找回密码
 加入
搜索
查看: 2430|回复: 2

[效率算法] 如何将文字中特定的字符写入数组中?

[复制链接]
发表于 2015-4-22 22:14:55 | 显示全部楼层 |阅读模式
变量为以下文字:

<a  href="http://www.wjgnet.com/1948-0210/full/v7/i2/343.htm" target="_blank">Baishideng Publishing Group Inc.</a><br><a  href="http://europepmc.org/abstract/MED/25815119" target="_blank">Europe PubMed Central</a><br><a  href="http://www.ncbi.nlm.nih.gov/pmc/articles/pmid/25815119/" target="_blank">PubMed Central</a>

是的,就这么多文字,别的字符我已经在得到网页源码后删掉了,只留下这些字符了,
需要提取链接和对应的文字到二维数组$a中。
$a[0][0]=http://www.wjgnet.com/1948-0210/full/v7/i2/343.htm
$a[0][1]=Baishideng Publishing Group Inc.
$a[1][0]=http://europepmc.org/abstract/MED/25815119
$a[1][1]=Europe PubMed Central
以些类推。。。。
发表于 2015-4-23 19:30:07 | 显示全部楼层
回复 1# sex123
#include <array.au3>
$str = ClipGet()
$aRe = StringRegExp($str, '(?i)href="([^"]+).+?>([^<>]+)</a',3)
If Not @error Then _ArrayDisplay($aRe)
发表于 2015-4-24 19:57:26 | 显示全部楼层
别理丫的,一直在扯淡,没建议性,都指着论坛的tx帮他解决问题呢
您需要登录后才可以回帖 登录 | 加入

本版积分规则

QQ|手机版|小黑屋|AUTOIT CN ( 鲁ICP备19019924号-1 )谷歌 百度

GMT+8, 2024-5-5 19:41 , Processed in 0.082051 second(s), 23 queries .

Powered by Discuz! X3.5 Licensed

© 2001-2024 Discuz! Team.

快速回复 返回顶部 返回列表