How to match the $ special character using regular expression in VB.NET

1 Answer

0 votes
Imports System
Imports System.Text.RegularExpressions

Public Class Program
	Public Shared Sub Main()
        Dim pattern As Regex = New Regex("\$")
        Dim s As String = "It's only $10.00 today"
		
        Dim match As Boolean = pattern.IsMatch(s)
		
        Console.WriteLine(match)
    End Sub
End Class



' run:
'
' True 
'

 



answered Feb 16, 2025 by avibootz
...