需要帮助..为什么我得到一个 ArgumentException 是 Unhandle。错误显示Unrecognized grouping construct
。我的模式错了吗?
WebClient client = new WebClient();
string contents = client.DownloadString("http://site.com");
string pattern =@"<td>\s*(?<no>\d+)\.\s*</td>\s*<td>\s*
<a class=""LN"" href=""[^""]*+""
onclick=""[^""]*+"">\s*+<b>(?<name>[^<]*+)
</b>\s*+</a>.*\s*</td>\s*+
<td align=""center"">[^<]*+</td>
\s*+<td>\s*+(?<locations>(?:<a href=""[^""]*+"">[^<]*+</a><br />\s*+)++)</td>";
foreach (Match match in Regex.Matches(contents, pattern, RegexOptions.IgnoreCase))
{
string no = match.Groups["no"].Value;
string name = match.Groups["name"].Value;
string locations = match.Groups["locations"].Value;
Console.WriteLine(no+" "+name+" "+locations);
}