From: Robert Klemme Date: 2009-11-27T16:15:15+09:00 Subject: Re: Help with regex On 11/27/2009 02:37 AM, Lucas Fialho wrote: > [Note: parts of this message were removed to make it a legal post.] > > thanks guys. I did not know about string scan! If you know there are always three groups you can also do: irb(main):006:0> s="t1 irb(main):007:0" t2 irb(main):008:0" t3---" => "t1\nt2\nt3---" irb(main):009:0> /([^\n]+)\n([^\n]+)\n([^\n]+)---/ =~ s => 0 irb(main):010:0> $1 => "t1" irb(main):011:0> $2 => "t2" irb(main):012:0> $3 => "t3" Cheers robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/