From: Robert Klemme Date: 2003-12-04T02:22:07+09:00 Subject: Re: Some Regexp "Michael campbell" schrieb im Newsbeitrag news:3FCDF61E.2010906@yahoo.com... > 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 > No that doesn't work since for each line there is a new entry in the array. But the OP wanted the texts to be in one string. robert