On Nov 6, 2012, at 15:39 , 7stud -- <lists / ruby-forum.com> wrote:

>  if md
>    results << $1 << " "
>  end
> end
> 
> p results.rstrip

results = []

...
results << $1 if md
...

puts results.join " "