ASP format HTML function code SDCMS enhanced version _ Application Tips

Source: Internet
Author: User
Tags chr
Copy Code code as follows:

'==============================
' Format Html,sdcms enhanced version
'==============================
Function nohtml (ByVal t0)
IF Len (t0) =0 Or IsNull (t0) Then
Nohtml= ""
Exit Function
End IF
Dim Regs,matches,match
Set regs=new Regexp
Regs.ignorecase=true
Regs.global=true
' Filter out Js,iframe
Regs.pattern = "<script.+?/script>"
T0=regs.replace (t0, "")
Regs.pattern = "<iframe.+?/iframe>"
T0=regs.replace (t0, "")
' And then filter other
Regs.pattern= "<.+?>"
Set Matches=regs.execute (t0)
IF matches.count>0 Then
For the Match in matches
T0=replace (T0,match.value, "")
Next
End IF
T0=replace (T0, "", "")
T0=replace (T0,vbcrlf, "")
T0=replace (T0, "", "")
T0=replace (T0, "", "")
T0=replace (T0,CHR (9), "")
T0=replace (T0,CHR (13), "")
T0=replace (T0,CHR (10), "")
T0=replace (T0,CHR (22), "")
Set regs=nothing
Nohtml=t0
End Function
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.