Hi forum,
I have a logfile with time stamps and messages in between:
Each line begins with a region code ('M'). Time stamps have just one space between the region code and the opening '[', message lines have two spaces.
I'm trying to delete sequences of time stamps without message lines in between using "find and replace with regexp":
(Unix-style): "^M \[.*\pM \["
(UE-Style): "%M [[]*^pM [[]"
I've first tested the regexp with a "find with regexp", and for both styles of regexp, the search result is not as expected: the result spans the message lines.
If there is no message line, the find result is as expected (from ">>ok>" to "<ok<<"), but if there are message lines in between, the find spans muliple lines (e.g. from ">>err>" to "<err<<")
How can I enforce that the "\p" resp. "^p" matches exactly one CR/LF pair?
Any help is greatly welcome...
I have a logfile with time stamps and messages in between:
Code: Select all
M [Thr 5580] Thu Jan 05 05:46:46 2006
M [Thr 4548] Thu Jan 05 05:46:46 2006
M [Thr 3464] Thu Jan 05 05:46:46 2006
M [Thr 3464] message1
M [Thr 3464] Thu Jan 05 05:47:46 2006
M [Thr 3464] message2
M [Thr 3464] Thu Jan 05 05:48:46 2006
M [Thr 3464] message3
M [Thr 4548] Thu Jan 05 05:48:47 2006
M [Thr 5580] Thu Jan 05 05:48:47 2006
M [Thr 4548] Thu Jan 05 05:48:48 2006
M [Thr 5580] Thu Jan 05 05:48:48 2006
M [Thr 3464] message4
I'm trying to delete sequences of time stamps without message lines in between using "find and replace with regexp":
(Unix-style): "^M \[.*\pM \["
(UE-Style): "%M [[]*^pM [[]"
I've first tested the regexp with a "find with regexp", and for both styles of regexp, the search result is not as expected: the result spans the message lines.
Code: Select all
>>ok>M [Thr 4548] Thu Jan 05 05:46:46 2006
M [<ok<<Thr 5580] Thu Jan 05 05:46:46 2006
M [Thr 4548] Thu Jan 05 05:46:46 2006
M [Thr 3464] message1
>>err>M [Thr 3464] Thu Jan 05 05:47:46 2006
M [Thr 3464] message2
M [<err<<Thr 3464] Thu Jan 05 05:48:46 2006
M [Thr 3464] message3
M [Thr 4548] Thu Jan 05 05:48:47 2006
M [Thr 5580] Thu Jan 05 05:48:47 2006
M [Thr 4548] Thu Jan 05 05:48:48 2006
M [Thr 5580] Thu Jan 05 05:48:48 2006
M [Thr 3464] message4
How can I enforce that the "\p" resp. "^p" matches exactly one CR/LF pair?
Any help is greatly welcome...