62,272
社区成员
发帖
与我相关
我的任务
分享string html = GetHtmlCode("http://www.ttkdex.com/pages/wdfb/2.html", Encoding.GetEncoding("gb2312"));
Regex reg = new Regex(@"(?i)(?<area>[^<>]*)</td>\s*</tr>(?:\s*<tr>(?:\s*<td[^>]*>\s*<a[^>]*>\s*<strong>(?<number>\d+)</strong></a>\s*</td>\s*<td[^>]*>\s*<a[^>]*>\s*<strong>(?<name>[^<>]*)</strong></a></div>\s*</td>)+\s*(?:<td[^>]*>\s* \s*</td>\s*<td[^>]*>\s* \s*</td>\s*)?</tr>)+");
MatchCollection mc = reg.Matches(html);
foreach (Match m in mc)
{
richTextBox2.Text += "所ù在ú地?区?:阰" + m.Groups["area"].Value + "\n--------------------\n";
foreach (Capture c in m.Groups["name"].Captures)
{
richTextBox2.Text += "公?司?分?部?名?称?:阰" + c.Value + "\n";
}
richTextBox2.Text += "======================\n\n";
} string html = GetHtmlCode("http://www.ttkdex.com/pages/wdfb/2.html", Encoding.GetEncoding("gb2312"));
Regex reg = new Regex(@"(?i)(?<area>[^<>]*)</td>\s*</tr>(?:\s*<tr>(?:\s*<td[^>]*>\s*<a[^>]*>\s*<strong>(?<number>\d+)</strong></a>\s*</td>\s*<td[^>]*>\s*<a[^>]*>\s*<strong>(?<name>[^<>]*)</strong></a></div>\s*</td>)+\s*(?:<td[^>]*>\s* \s*</td>\s*<td[^>]*>\s* \s*</td>\s*)?</tr>)+");
MatchCollection mc = reg.Matches(html);
foreach (Match m in mc)
{
richTextBox2.Text += "所在地区:" + m.Groups["area"].Value + "\n--------------------\n";
foreach (Capture c in m.Groups["name"].Captures)
{
richTextBox2.Text += "公司分部名称:" + c.Value + "\n";
}
richTextBox2.Text += "======================\n\n";
}