From: Hugh Sasse Staff Elec Eng Date: 2003-12-03T21:43:36+09:00 Subject: Re: Some Regexp On Wed, 3 Dec 2003, Dmitry V. Sabanin wrote: > Something like this should help: > > open = "TEXT1" > close = "TEXT2" > array = data.scan(/#{Regexp::quote(open)}(.*?)#{Regexp::quote(close)}/m).flatten > > I get: > array == ["\nsome text, tabs, CRLF etc 1\n", "\nsome text, tabs, CRLF etc 2\n", "\nsome text, tabs, CRLF etc 3\n"] > with your data. Interesting. This doesn't cope with nesting though. I've just tried that out. Is there a good way to do that with scan? Hugh