if capture is undefiend, do not decodeURIComponent

see the testcase

```
'/api'.match(/^\/api(\/.+)?/)
// =>
[ '/api', undefined, index: 0, input: '/api' ]
```

and `decodeURIComponent(undefined)` get `'undefiend'`