[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Simple awk question





On Fri, May 30, 2008 at 11:06 AM, John Allen <john.allen@dublinux.net> wrote:
Here is some sample Perl.

grep bounced /var/log/mail.log | perl -p -e 's|\w+ \w+ \w+ \w+ \w+ \w+ (\w+) (\w+) \w+ \w+ \w+ \w+ \w+ \w+ \w+ \w+ (.*)|\2 \1 \3|g'

Note about you could resume this regex with {} feature:

\w+ \w+ == (\w+ ){2}

and if you don't want to capture this, use start de group with (?:
The regex could be:

(?:\w ){6} (\w+) (\w+) (?:\w ){8}.*


Reply to: