Imports System
Imports System.Text.RegularExpressions

Public Class Test
	Public Shared Sub Main()
		Dim s As String = "( )yourstring()somevalue( )getit()"
			'A sample string.
			Dim rgx As New Regex("(?<BraceGroup>\([ ]*\))", RegexOptions.Singleline)
			'Regex pattern to match '( )' or '()'.
			Dim matches As MatchCollection = rgx.Matches(s)
			'Get all matches.
			Dim count As Integer = matches.Count
			'Number of matches.
			Console.WriteLine(String.Format("Total groups found : {0}", count))
	End Sub
End Class