class Regexp::MatchLength

def self.of(obj)

def self.of(obj)
  exp = obj.is_a?(Regexp::Expression::Base) ? obj : Regexp::Parser.parse(obj)
  exp.match_length
end