ASP functions for deleting JS Code and IFRAME tags from strings
Source: Internet
Author: User
1 '************************************** ***********
2 'remove all IFRAME tags including all variations of the tag from the string passed
3 function removeiframe (sinputstr)
4 removeiframe = removebyregexp ("<* IFRAME (. | \ r | \ n) +? /Iframe *> ", sinputstr)
5 end Function
6
'************************************** ***********
8' remove all JavaScript from the string passed
9 function removejscode (sinputstr)
10 removejscode = removebyregexp ("<* script (. | \ r | \ n) +? /* Script *> ", sinputstr)
11 end Function
12
13 '************************************** ***********
14 'remove some string from the string passed by Regular Expression
15 function removebyregexp (regexppattern, sinputstr)
16 dim objregexp
17
18 set objregexp = new Regexp
19 objregexp. ignorecase = true
20 objregexp. Global = true
21 objregexp. pattern = regexppattern
22 sinputstr = objregexp. Replace (sinputstr ,"")
23
24 set objregexp = nothing
25
26 removebyregexp = sinputstr
27 end Function
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