' regexreplace.vb
Imports System
Imports System.Net
Imports System.Text.RegularExpressions
Class RegexReplace
Shared Sub Main()
' @ITのトップページを取得
Dim wc As New WebClient()
Dim html As String = wc.DownloadString("http://www.atmarkit.co.jp/")
' や
Dim re1 As New Regex("<(no)?script.*?script>", _
RegexOptions.IgnoreCase Or RegexOptions.Singleline)
' すべてのタグ
Dim re2 As New Regex("<.*?>", RegexOptions.Singleline)
html = re1.Replace(html, "")
html = re2.Replace(html, "")
Console.WriteLine(html)
End Sub
End Class
' コンパイル方法:vbc regexreplace.vb