【发布时间】:2013-03-08 14:53:37
【问题描述】:
<a href="http://www.try.com"><strong>Try link word</strong></a>
你好。我怎样才能把这个字符串的一部分
http://www.try.com 和 尝试链接词
使用 c# 4.0 正则表达式?
我试过了,但没用;
var expression = @"<a href=""(.*?)""><strong>(.*?)</strong>";
Match m = Regex.Match(text, expression);
while (m.Success)
{
Response.Write("Match: " + m.Groups[0] + " <br> Area code: " + m.Groups[1] +"<br><hr><br>");
m = m.NextMatch();
}
【问题讨论】:
-
不工作怎么办?你得到了什么?
-
是打印=try.com"><strong>Try链接字
区号:try.com
标签: c# asp.net .net regex c#-4.0