/
(?x)
.+(?:Sub|Function)\ (\w+)\( # method declaration
(?: # start of parameter pattern
[\w\W]*?(?<=\b) # parameter may be preceded by ByVal or Optional keywords
([a-z]\w+)+ # parameter starts with a lower case
.*? # parameter may be followed by its type declaration
(?:=\ ([^\,]+)){0,1} # optional parameters may be followed by default value, it is captured to be used in method call
(?:,|\)) # parameter is