ASP正则表达式过滤html函数
ASP #正则 #函数2012-05-08 11:43
01 | <% |
02 | Option Explicit |
03 | Function stripHTML(strHTML) |
04 | 'Strips the HTML tags from strHTML |
05 | Dim objRegExp, strOutput |
06 | Set objRegExp = New Regexp |
07 | objRegExp.IgnoreCase = True |
08 | objRegExp.Global = True |
09 | objRegExp.Pattern = "<.+?>" |
10 | 'Replace all HTML tag matches with the empty string |
11 | strOutput = objRegExp.Replace(strHTML, "" ) |
12 | 'Replace all < and > with < and > |
13 | strOutput = Replace(strOutput, "<" , "<" ) |
14 | strOutput = Replace(strOutput, ">" , ">" ) |
15 | stripHTML = strOutput 'Return the value of strOutput |
16 | Set objRegExp = Nothing |
17 | End Function |
18 | %> |
相关文章
- ASP常用函数 2012/05/02
- ASP格式化时间日期函数 2012/04/30
- asp封装加密成dll文件 2012/04/27
- ASP连接Oracle数据库方法 2012/04/27
- ASP内容分页函数 2012/04/27
- asp无组件文件上传类 2012/04/27
- 防止ASP木马 2012/04/27
- asp操作Excel的类 2012/04/27
- asp防sql注入函数 2012/04/27
- ASP判断dll文件是否已注册的函数 2012/04/27