I thought I understood C# regular expressions, but clearly it’s not the case. I need some help devising an expression that would find everything from START|BEGIN until )). Expression can be multi line.
Ex.
START( FTP_STATE, XXX( VAL( FTP_INITIAL_STATE, 0 ) VAL( FTP_INBOUND, 1 ) AL( FTP_OUTBOUND, 2 ) )) /**************************************************************/ BEGIN( FTP_TIMER_MODE, YYY( VAL( FTP_REMOVE_TIMER, 0 ) VAL( FTP_NOT_REMOVE_TIMER, 1 ) )) /**************************************************************/
Any help greatly appreciated
Try this:
To explain it:
(?:START|BEGIN)Start with eitherSTARTorBEGIN.(?:[^)]+|\)[^)])+After that either any character other than a)([^)]+) or a)that is followed by any character other than)(\)[^)]) may follow. (So there is no way to match))with this expression.)\)\)Finally the)).I hope this will reduce backtracking.