PHP nos tiene acostumbrados a facilitarnos todo tipo de tareas, incluyendo funciones útiles para cualquier propósito de forma nativa, algo que no ocurre en ASP que te obliga a fabricarte tus propias subrutinas "a mano".
Por ejemplo en ASP clásico no existe un equivalente para strip_tags() que elimina los tags HTML a la cadena que se le pase como parámetro.
Aquí tienes dos funciones que hacen esto utilizando expresiones regulares:
'devuelve la cadena totalmente limpia de tags HTML
Function strip_tags(strHTML)
Dim regEx
Set regEx = New RegExp
With regEx
.Pattern = "<(.|\n)+?>"
.IgnoreCase = true
.Global = true
End With
strip_tags = regEx.replace(strHTML, "")
Set regEx = Nothing
End Function
'Esta segunda funcion permite pasar
'una lista de tags admitidos
Function strip_tags(strHTML, allowedTags)
Dim objRegExp, strOutput
Set objRegExp = New regexp
strOutput = strHTML
allowedTags = "," & LCase(Replace(allowedTags, " ", "")) & ","
objRegExp.IgnoreCase = true
objRegExp.Global = true
objRegExp.MultiLine = true
objRegExp.Pattern = "<(.|\n)+?>"
Set matches = objRegExp.execute(strHTML)
objRegExp.Pattern = "<(/?)(\w+)[^>]*>"
For Each match In matches
tagName = objRegExp.Replace(match.value, "$2")
If instr(allowedTags, "," & lcase(tagName) & ",") = 0 then
strOutput = replace(strOutput, match.value, "")
End If
Next
strip_tags = strOutput
Set objRegExp = Nothing
End Function