Asp.Net正则获取链接地址
2024-08-28 14:32:09
string html = “html代码”;
Regex reg = new Regex(@"(?is)<a[^>]*?href=(['""]?)(?<url>[^'""\s>]+)\1[^>]*>(?<text>(?:(?!</?a\b).)*)</a>");
MatchCollection mc = reg.Matches(html);foreach (Match m in mc)
{
string url = m.Groups["url"].Value;
string text = m.Groups["text"].Value;
}
最新文章
- (转)使用minicpan创建本地CPAN
- 在其他系统Iframe中显示SharePoint 页面
- btn css
- Droid4x快照还原
- AngularJS--学习笔记(一)
- RFS_javascript的使用
- 周赛-KIDx&#39;s Pagination 分类: 比赛 2015-08-02 08:23 7人阅读 评论(0) 收藏
- rsync拉取远程文件
- Struts2文件下载浅析
- [GIF] GIF Loop Coder - Introduction
- 《JavaScript dom 编程艺术》 placeholder占位符IE8兼容办法。
- overfitting
- 对HTML5标签的认识(四)
- 高可用Redis(九):Redis Sentinel
- CentOS7安装MySQL并配置账户等
- MVC 使用cshtml的一些基础知识-和相关整理
- struts实现邮件发送功能
- e-olymp Problem9 N-digit numbers(打表)
- MyBatis入参类型是List时判断非空
- 天蝎第一季/全集Scorpion迅雷下载
热门文章
- Ubuntu 12.04安装VMware Workstation8.0.3
- Alamofire使用报错Extra argument &#39;method&#39; in call解决办法
- git 错误信息 6 uncommitted changes would be overwritten by merge
- java mongodb 基础系列---查询,排序,limit,$in,$or,输出为list,创建索引,$ne 非操作
- WIFEXITED WEXITSTATUS WIFSIGNALED(转)
- 【struts2】自定义拦截器
- “The operation cannot be completed because the DbContext has been disposed” exception with lazy load disabled
- sql 置顶功能的查询
- java时区转化相关工具方法
- hadoop1.2.1+zk-3.4.5+hbase-0.94.1集群安装过程详解