「VB.NET」正規表現で文字を置き換えるサンプル
書式
Public Function Replace (oldChar As Char, newChar As Char) As String
oldChar のすべてのインスタンスが newChar で置き換えられることを除いて、このインスタンスと等価な文字列。
使用例
Imports System.Text.RegularExpressions
Module Module1
    Sub Main()
        Dim strA As String = "test-test"
        'sまたはtを意味する正規表現
        Dim target As New Regex("[st]")
        Console.WriteLine("置換前文字列: " + strA)
        '文字sまたはtを123に置換
        Console.WriteLine("置換後文字列: " + target.Replace(strA, "123"))
        Console.ReadKey()
    End Sub
End Module
結果
置換前文字列: test-test
置換後文字列: 123e123123-123e123123