|
登录后查才能浏览下载更多咨询,有问题联系QQ:3283999
您需要 登录 才可以下载或查看,没有账号?入住遨海湾
×
<%. J2 K* A8 B2 t2 ?5 w
Function RemoveHTML(strHTML)
2 y: ^7 Y' d5 P+ `9 s+ }8 _Dim objRegExp, Match, Matches : k4 h$ @6 P: C9 g9 h
Set objRegExp = New Regexp
% v' ^# a0 w/ _' E1 z
8 v8 g9 \1 W! d, N% lobjRegExp.IgnoreCase = True
, X$ v" F( u9 C* A# oobjRegExp.Global = True ( u) I% U$ _( p) M# W3 {, D, |% d
'取闭合的<> 1 ~5 [* f: n W7 S) B/ n! p1 R
objRegExp.Pattern = "<.+?>" # o# N" a. n" m" n( r, U6 o
'进行匹配
6 L5 E v' q2 i6 \% W( j1 k8 x, wSet Matches = objRegExp.Execute(strHTML)
8 O f: L3 _: q/ T& N( X& N) P# _% K' E2 A# E+ f5 c. x
' 遍历匹配集合,并替换掉匹配的项目
6 b; [7 y& V2 B' B& R0 m" qFor Each Match in Matches ) N! L. {8 Y* E# F7 @" o
strHtml=Replace(strHTML,Match.Value,"") 8 o. j2 S Q8 |3 R4 h7 d
Next 7 N7 g, `( q; h
RemoveHTML=strHTML " q$ ?! W$ O0 o" y, g- U9 W
Set objRegExp = Nothing
% \( Z; M m+ Yset Matches=nothing
% Q3 A" l; e+ q7 B3 {% ^/ P* D$ K# gEnd Function * @9 l" R" f( S* c: j4 T
%> |
|