Make re module return nil for unmatched captures instead of empty string

`(foo)?` != `((?:foo)?)`