Okinawa, Japan Fix: StringScanner#captures https://github.com/ruby/strscan/pull/72 (merged) s = StringScanner.new('foobarbaz') #=> #<StringScanner 0/9 @ "fooba..."> s.scan /(foo)(bar)(BAZ)?/ #=> "foobar" s.captures #=> ["foo", "bar", ""] s.captures.compact #=> ["foo", "bar", ""] s = StringScanner.new('foobarbaz') #=> #<StringScanner 0/9 @ "fooba..."> s.scan /(foo)(bar)(BAZ)?/ #=> "foobar" s.captures #=> ["foo", "bar", nil] s.captures.compact #=> ["foo", "bar"] Before (not yet documented) After (MatchData#captures like)