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

See  #1364 for context.