出50个大洋请人帮我写一段正则表达式,主要用来替换一些代码。
展开全部
网页的 比如
For j1 = 1 To ssq_xx.Length
Select Case j1
Case 1
Dim t1 As String = Regex.Replace(dlt_xx(1), " class=[^>]+>", "")
Dim t2 As String = Regex.Replace(t1, "<a[^>]+>", "")
cp_type = Regex.Replace(t1, "<[^>]+>", "") + vbNewLine
Case 2
Dim t1 As String = Regex.Replace(dlt_xx(2), " class=[^>]+>", "")
Dim t2 As String = Regex.Replace(t1, "<a[^>]+>", "")
cp_stage = Regex.Replace(t1, "<[^>]+>", "") + vbNewLine
Case 3
cp_time = Replace(Replace(dlt_xx(3), "</td>", ""), ">", "") & vbNewLine
Case 4
Dim t1 As String = Mid(Replace(dlt_xx(4), vbTab, ""), 2, Replace(dlt_xx(4), vbTab, "").Length)
Dim t2 As String = Regex.Replace(t1, "<a[^>]+>.*</a></td>", "")
Dim t3() As String = Split(t2, "<em ")
Dim t4 As String = ""
For k = 0 To 7
t4 += Regex.Replace(t3(k), "c[^>]+>", "") & " "
t4 = Replace(t4, vbCrLf, "")
t4 = Replace(t4, "</em>", "")
Next
t4 = Mid(t4, 1, 16) & "| " & Mid(t4, 17, 5)
cp_content = t4
End Select
Next
For j1 = 1 To ssq_xx.Length
Select Case j1
Case 1
Dim t1 As String = Regex.Replace(dlt_xx(1), " class=[^>]+>", "")
Dim t2 As String = Regex.Replace(t1, "<a[^>]+>", "")
cp_type = Regex.Replace(t1, "<[^>]+>", "") + vbNewLine
Case 2
Dim t1 As String = Regex.Replace(dlt_xx(2), " class=[^>]+>", "")
Dim t2 As String = Regex.Replace(t1, "<a[^>]+>", "")
cp_stage = Regex.Replace(t1, "<[^>]+>", "") + vbNewLine
Case 3
cp_time = Replace(Replace(dlt_xx(3), "</td>", ""), ">", "") & vbNewLine
Case 4
Dim t1 As String = Mid(Replace(dlt_xx(4), vbTab, ""), 2, Replace(dlt_xx(4), vbTab, "").Length)
Dim t2 As String = Regex.Replace(t1, "<a[^>]+>.*</a></td>", "")
Dim t3() As String = Split(t2, "<em ")
Dim t4 As String = ""
For k = 0 To 7
t4 += Regex.Replace(t3(k), "c[^>]+>", "") & " "
t4 = Replace(t4, vbCrLf, "")
t4 = Replace(t4, "</em>", "")
Next
t4 = Mid(t4, 1, 16) & "| " & Mid(t4, 17, 5)
cp_content = t4
End Select
Next
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询