专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅
  正好有时间所以用C#写了段正则表达式,作用是删除 Page 里面Code 中 HTML标签,这在做采集信息,消除其中HTML很有用处 以下是引用片段:publiccheckStr(html)   {     .Text.RegularExpressions.Regexregex1=.Text.RegularExpressions.Regex(@"<script[sS]+</script*>",.Text.RegularExpressions.RegexOptions.IgnoreCase);     .Text.Re [阅读全文] [PDF]
我们在开发过程中经常要用到的应该有HTML代码过滤这个函数吧,呵呵,很多人找来找去都不知道怎么实现,今天我来给大家贴一段代码轻松实现这个功能,好了来看代码吧 <scriptlanguage=\"javascript\"> publicstringcutStr(stringhtml) { System.Text.RegularExpressions.Regexregex1=newSystem.Text.RegularExpressions.Regex(@\"<script[\\s\\S]+</script*>\",Syste [阅读全文] [PDF]
<% FunctionRemoveHTML(strText) DimRegEx SetRegEx=NewRegExp RegEx.Pattern=\"<[^>]*>\" RegEx.Global=True RemoveHTML=RegEx.Replace(strText,\"\") EndFunction AA=\"<ahref=’http://www.xrss.cn’target=’_blank’>http://www.xrss.cn</a>\" Response.WriteRemoveHTML(AA) % [阅读全文] [PDF]
1 共3条 分1页