Permalink
Fetching contributors…
Cannot retrieve contributors at this time
19 lines (16 sloc) 546 Bytes
' Visual Basic .NET Document
Option Strict On
' <Snippet6>
Imports System.Text.RegularExpressions
Module Example
Public Sub Main()
Dim pattern As String = "\b(\w+)\s\1\b"
Dim substitution As String = "$+"
Dim input As String = "The the dog jumped over the fence fence."
Console.WriteLine(Regex.Replace(input, pattern, substitution, _
RegexOptions.IgnoreCase))
End Sub
End Module
' The example displays the following output:
' The dog jumped over the fence.
' </Snippet6>