Captain Chickenpants
Regular
I am wanting to parse a log file
which is of the form
And extract the Revision numbers and there associated comment.
Now I could easily enough just hard code it, but I thought that it would be more elegant to use a regular expression. The problem I seem to get is making it stop matching at the end of the comment.
Any ideas? (Unfortunatly I was doing this at home and so don't have the expression I had gotten so far, I think it was something along the lines of
\n\s*revision\s\d(\.\d)+\s*\n.*\n*
Which I think will match on the Revision header (and cope with revisions of the form 1.2.3). But the tricky bit is getting it to stop on the --------
CC
which is of the form
Code:
Some header information (over several lines)
------------------------------------------------
Revision 1.2
date: 2004/03/30 11:57:58; author: pcb; state: Exp; lines: +35 -5
Some comment here (multiline)
------------------------------------------------
Revision 1.3
date: 2004/03/30 12:50:58; author: pcb; state: Exp; lines: +35 -5
Some comment here
------------------------------------------------
And extract the Revision numbers and there associated comment.
Now I could easily enough just hard code it, but I thought that it would be more elegant to use a regular expression. The problem I seem to get is making it stop matching at the end of the comment.
Any ideas? (Unfortunatly I was doing this at home and so don't have the expression I had gotten so far, I think it was something along the lines of
\n\s*revision\s\d(\.\d)+\s*\n.*\n*
Which I think will match on the Revision header (and cope with revisions of the form 1.2.3). But the tricky bit is getting it to stop on the --------
CC