0

I am trying to come up with a regex that matches this pattern but it is not working properly. It needs to parse a header file and matches functions calls that look like this:

STDMETHOD(CreateBitmap)(
D2D1_SIZE_U size,
_In_opt_ CONST void *srcData,
UINT32 pitch, 
_In_ CONST D2D1_BITMAP_PROPERTIES *bitmapProperties,
_Outptr_ ID2D1Bitmap **bitmap 
) PURE;

but the arguments are variable and can be none. So in essence will be a match for this:

STDMETHOD(SomeMethodName)(
... a bunch of stuff multiple lines...
.... or nothing.....
) PURE;

Anyone suggests me a regex that matches this pattern across the header file? It needs to handle multiple line for the arguments.

I tried this without success.

\bSTDMETHOD(\b(.*)\;

gmmo
  • 2,577
  • 3
  • 30
  • 56
  • When posting a query on SO, always include what you'd tried until then and what issues you ran into. That would help others provide more constructive answers to help you out. Check out this link: http://stackoverflow.com/help/how-to-ask – jithinpt Apr 30 '15 at 21:17
  • tried \bSTDMETHOD\(\b(.*)\; – gmmo May 01 '15 at 01:36
  • it was answered here http://stackoverflow.com/questions/30003412/regex-multiline-not-working-on-repeated-patterns – gmmo May 02 '15 at 18:11

0 Answers0