You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Regex::MatchData#size returns the number of capture group, in other words m.size (m is Regex::MatchData instance) is difference from m.to_a.size always (m.size + 1 == m.to_a.size). size is very very popular method name on Crystal and Regex::MatchData looks like Array, so it makes me confusing.
I think group_size is better name for this method, and size should return same value of m.to_a.size. How do you think?
NOTE: Ruby's MatchData#size returns same value of m.to_a.size.
The text was updated successfully, but these errors were encountered:
Regex::MatchData#size
returns the number of capture group, in other wordsm.size
(m
isRegex::MatchData
instance) is difference fromm.to_a.size
always (m.size + 1 == m.to_a.size
).size
is very very popular method name on Crystal andRegex::MatchData
looks likeArray
, so it makes me confusing.I think
group_size
is better name for this method, andsize
should return same value ofm.to_a.size
. How do you think?NOTE: Ruby's
MatchData#size
returns same value ofm.to_a.size
.The text was updated successfully, but these errors were encountered: