From: Ittay Dror Date: 2008-09-25T14:57:34+09:00 Subject: Re: how to extract something in between a pattern --------------030408030306020303060208 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit suroot57@gmail.com wrote: > On Sep 22, 12:58 pm, Cheyne Li wrote: > >> Hi experts, >> >> I'm not very familiar with ruby's library. I wonder if there a method >> can extract something in a pattern? For example, >> >> I have a string: a=aabbcc

ccddee

>> >> I wanna get the anything between

and

, which is ccddee >> >> Thanks in advance. >> -- >> Posted viahttp://www.ruby-forum.com/. >> > > If you want to use regexp, a quick and dirty way would be : > > (a.split %r{})[1] > or: irb(main):001:0> a = 'aabbcc

ccddee

' => "aabbcc

ccddee

" irb(main):002:0> a[%r{

(.*)

}, 1] => "ccddee" > -- Ittay Dror Tikal Tikal Project -- -- Ittay Dror --------------030408030306020303060208--