I’d like to specifically strip any <iframe> code from my ASP String.
I’m currently using this:
Function stripTags(HTMLstring)
Set RegularExpressionObject = New RegExp
With RegularExpressionObject
.Pattern = "<[^>]+>"
.IgnoreCase = True
.Global = True
End With
stripTags = RegularExpressionObject.Replace(HTMLstring, "")
Set RegularExpressionObject = nothing
End Function
However, I realise this will remove ALL HTML, not just IFRAME code.
Can someone help?
Many thanks
You could try this:
This assumes that there is always a closing tag to the iframe, but this could be marked optional in the regular expression.