This should do the capturing you want:

#!/usr/bin/perl -w use strict; while(<DATA>){ chomp; print "$1\t$2\t$3\n" if /^(.+?\d{4})(?:.*\t){5}(.+)\t(.+)/; } __DATA__ ========== ======== ======= ==== ===== += ====== ================== START TIME END TIME VERSION USER SOURC +E STATUS STATUS DESCRIPTION ========== ======== ======= ==== ===== += ====== ================== August 26, 2004 1:21:04 AM August 26, 2004 1:22:16 AM 2. +0 system HA038974 Pending [BATCHMODE] +Started installation process September 5, 2004 2:49:03 AM September 5, 2004 2:49:37 AM + 2.0 system HA038974 Pending [BATCHM +ODE]Started installation process September 16, 2004 12:32:34 PM September 16, 2004 12:33:26 PM + 2.1 [kotzel_sup] HA038974 Pending S +tarted installation process September 16, 2004 4:44:28 PM September 16, 2004 4:44:34 PM + 2.1 [kotzel_sup] HA038974 Finished 23 + Successful, 8 Failed

It assumes tab delimiting.

TheEnigma


In reply to Re: RegEx : Filtering a log file by TheEnigma
in thread RegEx : Filtering a log file by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.