I am trying to get a regex expression to match multiple patterns with multilines but it keeps matching everything. For instance I want to match two times this code:
STDMETHOD(MyFunc)(
D2D1_SIZE_U size,
_In_opt_ CONST void *srcData,
) PURE;
STDMETHOD(MyFunc2)(
_In_opt_ CONST void *srcData2,
UINT32 pitch2,
) PURE;
I followed this link:
How do I match any character across multiple lines in a regular expression?
and came up with this pattern:
\bSTDMETHOD\b((.|\n|\r)*)\bPURE\b
however it does not work. The ((.|\n|\r)*)
matches the whole thing. I want it to stop when it finds "PURE". In other words a proper match would have given me two matches of the code above, but instead my expression only stops at the last "PURE" key word, making just one match.
let me know if you see why it does not work.