in reply to Re: Multiple Search and Replaces on one file
in thread Multiple Search and Replaces on one file

...but in his example line the first date-time string and the second are -clearly- different. The month happens to be the same in that example. You are taking the date from the first stamp and the time from the second.

Also there is a missing '.' from your first regex.

  • Comment on Re^2: Multiple Search and Replaces on one file

Replies are listed 'Best First'.
Re^3: Multiple Search and Replaces on one file
by Elijah (Hermit) on Jun 15, 2005 at 21:55 UTC
    Your making an assumption that each log entry does not have the same syntax. I am making the assumption that it does because that is what the OP's example shows. Where do you get your info from?

    Also I am not missing anything from my regexp. Maybe you think my example was trying to match something it was not.

      Here is his example:

      6/13/2005 5:59:57 PM 10.1.1.2 WARNING Jun 13 2005 22:00:04: %PIX-4-106 +023: Deny udp src aliens:192.168.1.35/1148 dst dmz:10.10.10.32/1434 b +y access-group "aliens"
      He said that he wanted to convert the Jun (in the second timestamp) to 06. Earlier in the log entry, there is another timestamp. The first timestamp appears to be from 5:59 pm, the second around 10:00 pm. You are making the assumption that the two datestrings in the log file are identical and interchangable.

      Regex error: "(%PIX+)" this matches what? "%PIX" and then an unlimited number of Xs? You surely mean "(%PIX.+)", since the way you have it deletes everything in his example log entry after the 'X'.