![]() |
|
Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: newlines in regular expressionsby conrad (Beadle) |
on Dec 07, 2004 at 10:29 UTC ( #412878=note: print w/replies, xml ) | Need Help?? |
None of the non-<>-print solutions I see here will cope with a single opening blank line since they all search for multiple \n characters. This does the trick using the /m modifier, which allows ^ to match the beginning of a line anywhere in your string: perl -p0777e 's/^\n+//mg'
In Section
Seekers of Perl Wisdom
|
|