in reply to remove specific data from a line
Update: After seeing your clarification, I see that you could have spaces in the comma-separated list. So you'd want:$line =~ s/^myword \S+//; # strip myword, a space, and any stretch of +non-spaces
$line =~ s/^ #strip, from the beginning of the string, myword\s+ #myword, followed by whitespace \S+ #followed by non-whitespace (?:,\s*\S+)* #followed by any number of comma, optional w +hitespace, non-whitespace //x; # update: two slashes are needed here
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: remove specific data from a line
by Anonymous Monk on Feb 03, 2006 at 09:54 UTC | |
by Roy Johnson (Monsignor) on Feb 03, 2006 at 18:29 UTC |