Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I have a file containing the following content:
Line1 Line2 Line3 XYZ: Blah
I'm trying to get:
Line1 Line2 Line3
Why does the following test case not work?
printf "Line1\nLine2\nLine3\n\nXYZ: Blah\n" | perl -p -e "s|\nXYZ.+\n| +|m"
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: multi-line RE question
by moritz (Cardinal) on Aug 02, 2011 at 11:35 UTC | |
by Anonymous Monk on Aug 02, 2011 at 11:47 UTC | |
|
Re: multi-line RE question
by Eliya (Vicar) on Aug 02, 2011 at 11:47 UTC | |
by jwkrahn (Abbot) on Aug 02, 2011 at 12:08 UTC | |
by Anonymous Monk on Aug 02, 2011 at 13:26 UTC | |
by Anonymous Monk on Aug 02, 2011 at 11:50 UTC | |
|
Re: multi-line RE question
by ww (Archbishop) on Aug 02, 2011 at 11:37 UTC |