Common forum hidden text elimination (VB.NET)
% |# m J! x( }" n# L3 @& I: e
1 p6 z8 E8 D8 k7 W
Now many forums in order to prevent copy, often add hidden text, such as the first two lines
I use regular expressions (Regular Expression) to decode with Replace
先Imports System.Text.RegularExpressions
'消掉前面隐藏字
Dim ex As New Regex("]*>(?:[^<]+|<(?!tableb[^>]*>))*?")
For Each m As Match In ex.Matches(TextBox1.Text)
For Each c As Capture In m.Captures
TextBox1.Text = Replace(TextBox1.Text, c.Value, "")
Next
Next
'消掉后面隐藏字
Dim ex2 As New Regex("]*>(?:[^<]+|<(?!tableb[^>]*>))*?")
' Dim ex2 As New Regex("<(?!br|/?p|b|/?font|font color)[^>]*>")
For Each m As Match In ex2.Matches(TextBox1.Text)
For Each c As Capture In m.Captures
' Debug.Print(c.Value)
TextBox1.Text = Replace(TextBox1.Text, c.Value, "")
Next
Next
Please correct me if wrong
Original: Big Box common forum elimination of hidden text (VB.NET)