Regex of HTML
2015-06-19 11:17
453 查看
Regex regexHtmlComment =
new Regex(@"<![^>]*>",
RegexOptions.Compiled |
RegexOptions.IgnoreCase | RegexOptions.Singleline);
Regex regexHtmlLink =
new Regex(@"<a\b[^>]+>(?<l>.+?)<*/a>",
RegexOptions.Compiled|
RegexOptions.IgnoreCase | RegexOptions.Singleline);
Regex regexHtmlTag =
new Regex(@"<[^>]*>",
RegexOptions.Compiled |
RegexOptions.IgnoreCase | RegexOptions.Singleline);
text =regexHtmlComment.Replace(text, " ");
text =regexHtmlLink.Replace(text, "${l}");
text =regexHtmlTag.Replace(text, " ");
new Regex(@"<![^>]*>",
RegexOptions.Compiled |
RegexOptions.IgnoreCase | RegexOptions.Singleline);
Regex regexHtmlLink =
new Regex(@"<a\b[^>]+>(?<l>.+?)<*/a>",
RegexOptions.Compiled|
RegexOptions.IgnoreCase | RegexOptions.Singleline);
Regex regexHtmlTag =
new Regex(@"<[^>]*>",
RegexOptions.Compiled |
RegexOptions.IgnoreCase | RegexOptions.Singleline);
text =regexHtmlComment.Replace(text, " ");
text =regexHtmlLink.Replace(text, "${l}");
text =regexHtmlTag.Replace(text, " ");
相关文章推荐
- Regex for HTML filtering
- html本地服务器
- 颜色表及html代码
- html不常用的标签
- HTML 头部代码
- 转摘有用文章 form表单的各种input的submit传值
- html表格 第五节
- html表单 第四节
- HTML主体标记
- html
- How to set the default input focus on a field in an HTML web form
- XHTML
- html初学问题集锦
- html页面中,如何防止文本过长(让文本自动换行)
- 静态HTML 间传递参数
- HTML
- C#中HTML/XML处理及正则表达式
- HTML--SVG基础
- html img热区坐标根据屏幕大小自适应
- HTML 5 <input> placeholder 属性