in reply to One liner

You're processing a line at a time, but the string your are trying to match spans two lines.

You could switch to paragraph mode.

perl -nle'BEGIN { $/ = "" } print /^Total SE ON.*?(\d+)/s' *

Replies are listed 'Best First'.
Re^2: One liner
by manav_gupta (Acolyte) on Jun 02, 2009 at 15:24 UTC
    Hmm... I did try that... but at least that particular version didn't work for me... Time to look at the paragraph mode.
      It's cause your blank lines aren't actually blank!
      $ perl -ple's/^\s+//' * | perl -ne'BEGIN { $/ = "" } print /^Total SE + ON.*?(\d+)/s' 39035