Home>

During the html editor publishing process,There will be some automatically generated html tags, or during the application process of the message board program,There will also be cases where someone maliciously writes some html code,So how to accurately filter out certain specific attribute tags and parameters?Here is the code:

<%
function replacetext (fstring, patrn, replstr)
Set regex=new regexp "Create a regular expression.
Regex.pattern=patrn "Set the pattern.
Regex.ignorecase=true "Set whether it is case sensitive.
Regex.global=true "Set global availability.
Replacetext=regex.replace (""&fstring&"", ""&replstr&"") "for replacement.
Set regex=nothing
end function
function mbrow (str)
Str=replacetext (str, "data-scayt_word =" "([^" "] *)" "" "," ")" Modify the properties of the blue part to the name of the property you are filtering.
Str=replacetext (str, "data-scaytid =" "([^" "] *)" "," ")" The red part is to filter out the quality in double quotes after the attribute
Mbrow=str
end function
%>
asp