in reply to Re^2: remove specific data from a line
in thread remove specific data from a line
or else just look for what you want to keep at the end:s/abc\w+\s+\w+(?:, *\w+)\s+//; # match and remove unwanted initial co +ntent
And of course, if you know in advance how those last two tokens are spelled, you could even use rindex() and substr():s/.*\s(\w+\s+\w+)$/$1/; # match desired end content and remove everyt +hing before it
$_ = substr( $_, rindex( $_, 'yuio jklh' ));
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: remove specific data from a line
by Anonymous Monk on Feb 03, 2006 at 10:06 UTC |