component/path-to-regexp — pull request #6 by blakeembrey (2014-03-07 18:21:51+00:00)
Title: Match entire substring when using options.end

I'm currently writing an Express module (and Koa module) to do dynamic mounting (like `app.use`, but with params) and the recent addition of `options.end` is perfect. However, it reveals an issue with the regex where it doesn't match the entire substring between slashes.

Currently:

```js
var re = pathToRegExp('/:test');

re.match('/pathname'); //=> [ '/p', 'p', index: 0, input: '/pathname' ]
```

With this patch:

```js
var re = pathToRegExp('/:test');

re.match('/pathname'); //=> [ '/pathname', 'pathname', index: 0, input: '/pathname' ]
```