窗口粘贴网页内容时,希望将除段落<p>以外的标签都过滤掉。
请老师帮助解决:
1、下面加黑的过滤标签代码,怎样修改;
2、代码放在哪里?
谢谢!
If ClipBoard.ContainsText Then '剪贴板替换
Dim s As String = ClipBoard.GetText()
Dim strText As String = System.Text.RegularExpressions.Regex.Replace(s, "<br>|<BR>|<br/>|<BR/>", chr(11))
strText = System.Text.RegularExpressions.Regex.Replace(strText, "<[^>]+?>", "")
strText = System.Text.RegularExpressions.Regex.Replace(strText, chr(11), "<br/>")
s = strText
'Return strText
End If