get网址,返回数据
<a href="http://as.xxx.com/" onclick="co('as')">鞍山</a><a href="http://ay.xxx.com/" onclick="co('ay')">安阳
...
...
</a>里面有大量类似上述的代码,
特征码
co('as')
co('ay')
如何提取得到代码中类似
as
ay
..
<a href="http://as.xxx.com/" onclick="co('as')">鞍山</a><a href="http://ay.xxx.com/" onclick="co('ay')">安阳
...
...
</a>里面有大量类似上述的代码,
特征码
co('as')
co('ay')
如何提取得到代码中类似
as
ay
..
...
...
</a>";
MatchCollection matches = Regex.Matches(s, @"(?is)(?<=onclick=""co\(')[^']+(?='\))");
foreach (Match match in matches)
Response.Write(match.Value + "<br/>");
输出:
as
ay