in reply to Re: Re^2: modifying a line in a file with some restrictions
in thread modifying a line in a file with some restrictions
The text replace would be the last line of the paragraph plus the two or more newlines that delimited the paragraph.Good catch about the (one!) newline, but I'm puzzled at how you arrive at other the conclusion. He is using /m which doesn't make the dot match newlines.
Yes, perlre is a good suggestion. ;-)$ perl -le'(join "\n", qw(foo bar baz)) =~ /(.*\n)/m && print $1' foo $ # note the embedded newline
Makeshifts last the longest.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re^4: modifying a line in a file with some restrictions
by BrowserUk (Patriarch) on Jan 14, 2003 at 10:12 UTC | |
by Aristotle (Chancellor) on Jan 14, 2003 at 10:26 UTC |