Author: imperialx | Posted on: 5/5/2009 10:30:59 PM | Views : 267

Hi,
    I couldn't remove some special characters using regular expression below.

     Public Function removeSpecialCharacters(ByVal stringValue As String)
        Dim Text As String = "H@i, % ni~ce! t\o &me!et y&ou)." 'HTMLstring
        Dim Pattern As String = "~!@,#$%^&*()_+`=[{}]"
        Dim oRegex As Regex = New Regex(Pattern, RegexOptions.IgnoreCase)
        Dim matches As MatchCollection = oRegex.Matches(Text)

        For Each nextMatch In matches
            Text = oRegex.Replace(Text, ".", 1)
        Next Go to the complete details ...