Method: MatchData#length

Defined in:
re.c

#sizeInteger

Returns size of the match array:

m = /(.)(.)(\d+)(\d)/.match("THX1138.")
# => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
m.size # => 5

Returns:



1183
1184
1185
1186
1187
1188
# File 're.c', line 1183

static VALUE
match_size(VALUE match)
{
    match_check(match);
    return INT2FIX(RMATCH_REGS(match)->num_regs);
}