![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
正则
whyabc
这个作者很懒,什么都没留下…
展开
-
匹配html中的A标签
匹配html中的A标签 \s]+))\s+)*)(href\s*=\s*("([^"]*)"|'([^']*)'|([^'">\s]+)))((\s+\w+\s*=\s*("([^"]*)"|'([^']*)'|([^'">\s]+)))*)\s*>(.*?) 替换其中的链接到统计页面再跳转到真正的链接地址 protected void Unnamed1_Click(o翻译 2014-01-19 11:51:38 · 832 阅读 · 0 评论 -
匹配得到A标签href的内容
string strRegex = "<a[\\s\\S]*?href[\\s]*=[\\s]*[\"|']([\\s\\S]*?)[\"|']"; // 得到一个href值 Regex r; MatchCollection m; r = new Regex("<a[\\s\\S]*?href[\\s]*=[\\s]*[\"|']([\\s\\S]*?)[\"|']", RegexOptions.原创 2014-01-19 13:43:38 · 2903 阅读 · 0 评论