Skip to content
instance method

MatchData#size

() -> ::Integer
size → integer

Returns size of the match array:

Example
m = /(.)(.)(\d+)(\d)/.match("THX1138.")
# => #<MatchData "HX1138" 1:"H" 2:"X" 3:"113" 4:"8">
m.size # => 5
See also #regexp #string #pre_match #to_a also in 4.1 · 3.4 · 3.3 · 3.2 · 3.1 · 3.0