From: Kenichi Kamiya Date: 2012-02-16T01:52:47+09:00 Subject: Re: String#scan returns a two-dimensional array You mean like this? $VERBOSE = true str = "Hello world" # get first capture str.slice(/Hello (.*)/, 1) #=> "world" str[/Hello (.*)/, 1] #=> "world" /Hello (.*)/.match(str)[1] #=> "world" /Hello (.*)/ =~ str; $1 #=> "world" # one dimensional array /(.*) (.*)/.match(str).captures #=> ["Hello", "world"] -- Posted via http://www.ruby-forum.com/.