<a href="http://china.alibaba.com/member/profile.htm?member_id=参数" target=_blank class="uol" >梁俊松</a>
先生这样一段html标记 变的内容为 参数部分和人名部分 还有先生(称呼)部分 我想用正则匹配得到人名和称呼 如何得到 很急 多谢高手!
先生这样一段html标记 变的内容为 参数部分和人名部分 还有先生(称呼)部分 我想用正则匹配得到人名和称呼 如何得到 很急 多谢高手!
^[\u4e00-\u9fa5]+$
if (m.Success)
{
richTextBox2.Text += m.Groups["id"].Value + "\n";
richTextBox2.Text += m.Groups["name"].Value + "\n";
richTextBox2.Text += m.Groups["app"].Value + "\n";
}
string strPattern=@"a[\s]+href=(?<Link>[^\s>]+)[^>]*>(?<Text>[^<]*)</a>";
MatchCollection Matches=Regex.Matches(webDocContent,strPattern,RegexOptions.IgnoreCase|RegexOptions.Compiled);
foreach(Match NextMatch in Matches)
{
string URL=NextMatch.Groups["Link"].Value.ToString().Trim();
string URLText=NextMatch.Groups["Text"].Value.ToString().Trim(); } string strPageContent = string.Empty;
StreamReader srPage = new StreamReader(@"e:\save.txt",System.Text.Encoding.GetEncoding("gb2312"));
strPageContent = srPage.ReadToEnd();
srPage.Close();
MatchCollection TitleMatchs = Regex.Matches(strPageContent, "<td>((\\s)*(.*?)(\\s)*(.*?)(\\s)*(.*?)(\\s)*(.*?)(\\s)*)</td>", RegexOptions.IgnoreCase | RegexOptions.Multiline );
foreach(Match NextMatch in TitleMatchs)
{
Label1.Text += NextMatch.Groups[1].Value;
}