From: salai Date: 2009-10-26T22:07:34+09:00 Subject: Re: Try to copy text between two know string Hi Ahmad, def methode_name test = 100; puts test (1..test).each { |i| puts i } # (1...test).each { |i| puts i } # 1 to 100 end puts methode_name On Mon, Oct 26, 2009 at 8:33 AM, Ahmad Azizan wrote: > Hello, > > I have a sample text, like this; > > eg; > def >   test = 100; >   puts test >   (1..10).each { |i| puts i } > end > > how can I copy the text in range between 'def' and 'end', which are > test = 100; > puts test > (1..10).each { |i| puts i } > > into a variable. > I've tried using ~/def ... ~/end but not matched > -- > Posted via http://www.ruby-forum.com/. > >