Re: [SLUG] extract a block of text between tags.

From: btt@nethouse.com
Date: Fri Jul 25 2003 - 18:53:47 EDT


On Fri, Jul 25, 2003 at 05:18:56PM -0400, Dylan William Hardison wrote:
> I think this would work better:
> perl -ne'print if /begin/ .. /end/' file
>
> or this:
> perl -ne'print if s/begin// .. s/end//' file

I like it! I would only modify it thusly:

perl -ne 'print if s/^begin// .. s/^end//' file

or similarly in order to keep from ending too soon on some word
containing the end tag.

Happy Friday,
Bill



This archive was generated by hypermail 2.1.3 : Fri Aug 01 2014 - 19:57:08 EDT