From: Ross Bamford Date: 2005-12-19T02:27:46+09:00 Subject: Re: How to grep the shortly matching in a string On Sun, 18 Dec 2005 16:45:49 -0000, wrote: >> Obviously it doesn't do quite what you want (you need an array) but >> that part should be easy to add... > > scan returns an array, so just grab it: > > results = s.scan(/.../).flatten # flatten because of the ()'s > I _knew_ I was missing something. In mitigation, I'd like to say that it was my first mail-check of the day. Unfortunately, it makes no difference because I'd completely forgotten about scan (etc) with no block anyway, so I had it returning the string :P Thanks, David :) -- Ross Bamford - rosco@roscopeco.remove.co.uk