in reply to Regexp parses only first line correctly

The 'partition' part of a line should be matched by
\/\w*
(no character class needed, and note '*' quantifier). Change the first line of your regex to
\s+ \w+: \s \/\w* \s+ # host, partition
and it will work (at least it does here).

Updated: added bit to note change in quantifier relative to OP.

Replies are listed 'Best First'.
Re^2: Regexp parses only first line correctly
by NetWallah (Canon) on Aug 16, 2008 at 19:22 UTC
    I had that initial suggestion as well, but withdrew that recommendation because it will fail if the line contains a path with more than one slash, such as :
    hostname: /dir3/dir4 level=incr, 1449 MB 00:56:31 46 + files
    Keeping the character class, but correcting repetition will work in this case as well.

         Have you been high today? I see the nuns are gay! My brother yelled to me...I love you inside Ed - Benny Lava, by Buffalax

      Yes, I see that you (almost completely) changed your original reply, but with no indication of the changes.

      Even better might be

      \s+ \w+: \s /\w*(?:/\w+)* \s+ # host, partition
      Update: Getting a regex in there that matches all possible (legal) path specifications is more complicated than what I have here. Usual advisories about "know your data" apply.