instance method MatchData#to_a

to_a -> [String][permalink][rdoc][edit]

$&, $1, $2,... を格納した配列を返します。



/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.to_a       # => ["foobar", "foo", "bar", nil]

[SEE_ALSO] MatchData#captures