From: Brian Candler Date: 2010-12-30T15:11:36+09:00 Subject: Re: Ruby array to C pointer Chananya Freiman wrote in post #971174: > it will still fail if you try to search for > every letter between the tags (as in .*) because it will only stop at > the last encounter of . ... > Is there a clean way to do this? Yes, use non-greedy matching: .*? >> a = < aaa text bla bla EOS => " \n aaa\n \n \n text bla bla\n \n" >> a.scan(%r{(.*?)}m) => [["\n aaa\n "], ["\n text bla bla\n "]] -- Posted via http://www.ruby-forum.com/.