I am trying to build a regex to identify the parameterized property of VB.
Example code of a parameterized property i want to match
Public ReadOnly Property Test(v as String) As Integer
Public ReadOnly Property Test(ByVal v as String) As ReadOnlyCollection(Of Guid)
Example code of a property i want to avoid
Public ReadOnly Property Test() As Integer
Public ReadOnly Property Test() As ReadOnlyCollection(Of Guid)
Basically if there are any parameters passed to the property i want it to match, but there are other cases with other parenthesis in the same line as the type of the property that might not have parameters. The pattern i see is
property [0 or more empty space] [next word] [0 or more empty space] ( [0 or more empty space] Target characters OR Ignore WhiteSpace [0 or more empty space] )
This is what i have so far
Property?\s+(\w+)\s*(\([^()]*\))
Sadly it does not ignore cases with the empty parenthesis.