【发布时间】:2009-10-20 14:17:40
【问题描述】:
我有一个字符串流,里面有很多这样的字符串:
<A style="FONT-WEIGHT: bold" id=thread_title_559960 href="http://microsoft.com/forum/f80/topicName-1234/">Beautiful Topic Name</A> </DIV>
我正在尝试获取以下开头的适当链接:
style="FONT-WEIGHT: bold
所以最后我会有链接:
http://microsoft.com/forum/f80/topicName-1234/
Topic Id:
1234
Topic Display Name:
Beautiful Topic Name
I am using this pattern, right now, but it doesn't do it all:
"href=\"(?<url>.*?)\">(?<title>.*?)</A>"
因为还有其他以href开头的链接。
为了使用正则表达式,我在一行字符串中添加了所有行。正则表达式是否关心新行? IE 可以继续匹配跨多行的字符串吗?
请帮我看看这个模式。
【问题讨论】: