Dim str As String = FileSys.ReadAllText("g:\test.txt", Encoding.Default) str = str.replace(chr(10), "").Replace(chr(13), "") Dim mc1 = System.Text.RegularExpressions.Regex.Matches(str,"<LI>.+?</LI>") For i As Integer = 0 To mc1.count-1 Dim s As String = mc1(i).value Dim idx As Integer = s.IndexOf("<a ") Dim ns As String = s.SubString(4, idx-4) Dim ns2 As String = s.Replace(ns, "") Dim idx2 As Integer = ns2.IndexOf("</a>") ns2 = ns2.Insert(idx2, ns.trim) str = str.Replace(s, ns2) Next output.show(str)
|