develooper Front page | perl.beginners | Postings from March 2002

Simple regex question

Thread Next
From:
Rob Lee
Date:
March 30, 2002 03:12
Subject:
Simple regex question
Message ID:
Pine.LNX.4.33.0203291358450.15543-100000@aberdeen.fpcc.net

I'm parsing a file with multiple Fortran-like blocks that look like:
	START_KEYWORD
		line 1
		line 2
	END_KEYWORD

I want only the contents of each block, not the keywords.

grep { /START_KEYWORD/.../END_KEYWORD/ } 
returns the entire block - including the start and end keywords.

Is there a slick way to only return the contents of the block (line 1 and 
line 2)?

-Rob



Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About