The following code does not replace the middle of ld<sad, so the content is still normal
Copy Code code as follows:
<%
function nohtml (str)
Dim re
Set re=new REGEXP
Re. IgnoreCase =true
Re. Global=true
Re. Pattern= "(\<.[ ^\<]*\>) "
Str=re.replace (str, "")
Re. Pattern= "(\<\/[^\<]*\>)"
Str=re.replace (str, "")
Str=replace (str, "", "")
Str=replace (str, "", "")
Nohtml=str
Set re=nothing
End Function
Str= "<TITLE>SADJKSJDL Cloud Communities welcome you sajdljsald<sadsadsad<br>" ' Here is the test
Response.Write nohtml (str)
%>
The results are:
Copy Code code as follows:
Welcome to SADJKSJDL Cloud-dwelling community Sajdljsald<sadsadsad
But the following code is not asked, directly to see < forget the following unlimited matching
Copy Code code as follows:
<%
Function drophtml (Byval strhtml)
Dim objRegExp, Match, Matches
Set objRegExp = New Regexp
Objregexp.ignorecase = True
Objregexp.global = True
' Take the closed <>
Objregexp.pattern = "<.+?>"
' to match
Set matches = Objregexp.execute (strhtml)
' Iterate through the matching set and replace the matching item
For the Match in matches
Strhtml=replace (Strhtml,match.value, "")
Next
Drophtml=strhtml
Set objRegExp = Nothing
End Function
Str= "<TITLE>SADJKSJDL Cloud Communities welcome you sajdljsald<sadsadsad<br>" ' Here is the test
Response.Write drophtml (str)
%>
The results are:
Copy Code code as follows:
Welcome to SADJKSJDL Cloud-dwelling community Sajdljsald