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));
}
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));
}