Of course this should be a normal filtering technique, and there is a final pole of filtering HTML tags, it is a pair of angle brackets and all the words in the angle brackets enclosed replace not display, the method for the content must describe the content of the angle bracket filter too far.
However, there is always a need to replace all the angle brackets all the time, it is obvious that the need for regular, there are two types of code, the first one is as follows:
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, "")
Nohtml=str
Set re=nothing
End Function
The second type:
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, "")
Nohtml=str
Set re=nothing
End Function
Simple application:
<script language= "vbs" > Function nohtml (str) Dim re Set re=new RegExp re. IgnoreCase =true Re. Global=true Re. Pattern= "< (. [ ^>]*) > "Str=re.replace (str," ") Nohtml=str set re=nothing end Function alert (nohtml > Cloud-dwelling community ") </script>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]