Code
String p = @"(?s)<a[\s][^>]*href\s*=\s*[\""\']?(?<url>([^\""\'>\s]*))[\""\']?[^>]*>(?<title>([^<]+|.*?)?)</a\s*>";
Regex reg = new Regex(p, RegexOptions.IgnoreCase | RegexOptions.Compiled);
MatchCollection ms = reg.Matches(TextBox1.Text);
foreach (Match m in ms)
{
Response.Write(String.Format("链接{1} &&& 内容{0}<br>", m.Groups["title"].Value, m.Groups["url"].Value));
}
posted @
2009-09-30 10:21
子午
阅读(
1112)
评论()
编辑
收藏
举报