On Tue, 2008-09-30 at 17:37 +0200, Matthias Leopold wrote:
> hi,
> 
> can someone please explain to me how to match patterns that contain 
> newlines?
> 
> when file.txt contains
> 
> aaa
> bbb
> ccc
> ddd
> eee
> 
> why doesn't
> 
> perl -pe 's/bbb.*?ddd//s;' file.txt
> 
> remove lines 2-4?

You didn't slurp your input.

perl -pe 'BEGIN{$/=undef};s/bbb.*?ddd//s;' file.txt


-- 
Just my 0.00000002 million dollars worth,
  Shawn

Linux is obsolete.
-- Andrew Tanenbaum


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to