From: Michael campbell Date: 2003-12-03T23:41:40+09:00 Subject: Re: Some Regexp Dmitry N Orlov wrote: > I want to get array from file like this: > > TEXT1 > some text, tabs, CRLF etc 1 > TEXT2 > TEXT1 > some text, tabs, CRLF etc 2 > TEXT2 > TEXT1 > some text, tabs, CRLF etc 3 > TEXT2 > ........ > > Array mast constists of "some text, tabs, CRLF etc 1", "some text, > tabs, CRLF etc 2" You could do something like this (until, as I understand it, this feature is to be removed): arr = Array.new() while (line = gets) arr << line if (line =~ /TEXT1/) .. (line =~ /TEXT2/) end (You can shorten that up even more, but I think this gets the point across.)