From: Ron Coutts Date: 2003-12-16T06:14:07+09:00 Subject: Extracting multiple lines from a file This should be an easy question for Ruby-heads but I can't seem to easily find the answer. I need to extract multiple lines from a file where the lines are delimited by some other text. For example, with file contents as shown below I'd like to extract the content between the BEGIN_FOO and END_FOO lines. Can anyone tell me how to do that? BEGIN_FOO Some foo stuff here. More foo stuff. END_FOO I've done this before in Perl (can't remember the syntax) so I'm thinking it should be possible in Ruby. Ron