in reply to remove extra spaces/characters after a given result is found

See perlretut and perlre.

use strict; use warnings; while (<DATA>) { chomp; next unless /description\s+ ([^\s]+)/x; print "$1\n"; } __DATA__ description c3560-a68.mud g6/20-g7/2 description c3560-a68.mud :::Leaf::: description c3560-a68.mud blah blah

Prints:

c3560-a68.mud c3560-a68.mud c3560-a68.mud

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: remove extra spaces/characters after a given result is found
by nidhi (Acolyte) on Aug 28, 2007 at 00:09 UTC
    thanq grandfather .^_^.