instance method
MatchData#to_a
() -> ::Array[::String?]
to_a → array
re.c
View on GitHub ↗
static VALUE
match_to_a(VALUE match)
{
return match_array(match, 0);
}
Returns the array of matches:
Example
m = /(.)(.)(\d+)(\d)/.match("THX1138.") # => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8"> m.to_a # => ["HX1138", "H", "X", "113", "8"]
Related: MatchData#captures.