Strip HTML Tags from String using Regular Expressions
Sub Regex_Replace_Example()
Dim oReg As Regex
Dim sInput As String
Dim sOut As String
' Strip of Simple HTML Tags
sInput = "This is a HTML Text"
oReg = New Regex("")
sOut = oReg.Replace(sInput, "?\W+>", "")
' Strip of Complex HTML Tags
sInput = "This is a HTML Text with images "
oReg = New Regex("")
sOut = oReg.Replace(sInput, "<[^<>]+>", "")
End Sub
Extract Ref Links From WebPage using VB.Net Regular Expressions
Remove HTML Tags from String using .NET Regular Expressions
VB.NET Regular Expression to Check URL
VB.NET Regular Expression to Check Email Addresses
VB.NET Regular Expression to Check MAC Address
Regular Expression to Check Zip Code
Validate eMail Addresses using VB.NET Function
Regular Expressions in Dot Net (.NET)
To remove only Particular HTML tag see
ReplyDeletehttp://urenjoy.blogspot.com/2008/10/remove-html-tags-from-string.html
If you are compiling with strict mode, you'll get this warning on line to call the replace method:
ReplyDeletewarning BC42025: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.
Any idea how the replace method should be called to avoid this warning?
Strict mode set to true can not be set to false in my case.
Instead of this:
ReplyDeleteoReg = New Regex("")
sOut = oReg.Replace(sInput, "<[^<>]+>", "")
Use this:
sOut = Regex.Replace(sInput, "<[^<>]+>", "")
To avoid this warning when compiling with strict mode set to true:
warning BC42025: Access of shared member, constant member, enum member or nested type through an instance; qualifying expression will not be evaluated.