I'd like to extract all the parameters of these methods with a regex. However, due to the SAL markings, I can't get the nested parenthesis to work correctly. I have these string to parse (multi-lined):
STDMETHOD_(void, Method1)(
_Out_writes_to_(gradientStopsCount, _Inexpressible_("Retrieved through GetGradientStopCount") ) D2D1_GRADIENT_STOP *gradientStops,
UINT32 gradientStopsCount) CONST PURE;
STDMETHOD_(void, Method1)(
_Out_writes_to_(gradientStopsCount, _Inexpressible_("Retrieved through GetGradientStopCount") ) D2D1_GRADIENT_STOP *gradientStops,
UINT32 gradientStopsCount) CONST PURE;
I tried this:
\(((.|\n|\r)*?)\)
But because there are nested parenthesis for the parameters, it won't match properly. Indeed I'd like to extract everything including nested parenthesis of a string like
MyFunc(...anything in here including more parenthesis...)
Is is doable with one single regex?